}
private QueryHits getQueryHits(Searcher searcher, Integer n) throws IOException {
org.apache.lucene.search.Query query = filterQueryByClasses(luceneQuery);
buildFilters();
QueryHits queryHits;
if (n == null) { // try to make sure that we get the right amount of top docs
queryHits = new QueryHits(searcher, query, filter, sort);
} else {
queryHits = new QueryHits(searcher, query, filter, sort, n);
}
resultSize = queryHits.totalHits;
return queryHits;
}