private void purgeAll(Class<?>... entityTypes) throws Exception {
FullTextEntityManager fullTextEm = Search.getFullTextEntityManager( createEntityManager() );
for ( Class<?> entityType : entityTypes ) {
fullTextEm.purgeAll( entityType );
fullTextEm.flushToIndexes();
}
int numDocs = fullTextEm.getSearchFactory().getIndexReaderAccessor().open( entityTypes ).numDocs();
close( fullTextEm );
assertThat( numDocs ).isEqualTo( 0 );
}