Restriction « Search « JPA Q&A





1. Hibernate search with Criteria restriction returning incorrect count    stackoverflow.com

The result list is perfect but the getResultSize() is incorrect. I've knocked up some code to illustrate.

Criteria criteria2 = this.getSession().createCriteria(Film.class);             ...

2. How to work around the hibernate search (lucene) criteria restriction plus getResultSize issue?    stackoverflow.com

Hibernate search (lucene) has an issue: If you apply a criteria restriction to FullTextQuery and apply pagination restrictions, i.e. criteria.setMaxResults() and criteria.setFirstResult(), the fullTextQuery.getResultSize() returns a count which doesn't include the ...