how to Hibernate Search FullTextQuery getResultSize never matches getResultList().size()?

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()

         BooleanJunction junction = this.builder.createAlgorithm(
                    searchRequest, qb);
 luceneQueryluceneQuery = junction.createQuery();



        FullTextQuery jpaQuery = this.inventoryRepo.getSearchManager()
                .createFullTextQuery(luceneQuery, Inventory.class);


        List results = jpaQuery.getResultList();

        log.debug("Total Search Result Size: " + jpaQuery.getResultSize());

asked May 16, 2015 in hibernate by rajesh
0 votes

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.