Does anyone have a clue why Hibernate Search FullTextQuery
(FullTextEntityManager) getResultSize()
never matches the getResultList().size()
?
I am not passing anything to setFirstResult
or setMaxResult
.
For example, I do a query on one field for the word "truck" the resultSize says 50,345, but the ResultList.size()
is 865. Does anyone know of any reason these would be so far off? I have cleared the Lucene indexes and rebuilt them, but it still doesn't work. I am baffled.
QueryBuilder qb = this.inventoryRepo.getSearchManager()
.getSearchFactory().buildQueryBuilder()
.forEntity(Inventory.class).get();
BooleanJunction<?> junction = this.builder.createAlgorithm(
searchRequest, qb);
org.apache.lucene.search.Query luceneQueryluceneQuery = junction.createQuery();
}
searchResult.setQuery(luceneQuery.toString());
FullTextQuery jpaQuery = this.inventoryRepo.getSearchManager()
.createFullTextQuery(luceneQuery, Inventory.class);
jpaQuery.limitExecutionTimeTo(20000,
TimeUnit.MILLISECONDS);
List<Inventory> results = jpaQuery.getResultList();
log.debug("Total Search Result Size: " + jpaQuery.getResultSize());
searchResult.setTotalSize(jpaQuery.getResultSize());