int numDocsForeigner = countSizeForType( IterableBridgeTestEntity.class );
return numDocsForeigner == 0;
}
private int countSizeForType(Class<?> type) {
SearchFactory searchFactory = fullTextSession.getSearchFactory();
int numDocs = -1; // to have it fail in case of errors
IndexReader locationIndexReader = searchFactory.getIndexReaderAccessor().open( type );
try {
numDocs = locationIndexReader.numDocs();
}
finally {
searchFactory.getIndexReaderAccessor().close( locationIndexReader );
}
return numDocs;
}