pagination « Search « JPA Q&A

1. Hibernate Search Paging + FullTextSearch + Criteria

I am trying to do a search with some criteria

FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(finalQuery, KnowledgeBaseSolution.class).setCriteriaQuery(criteria);
and then page it
//Gives me around 700 results
//Some pages are empty
fullTextQuery.setFirstResult(( (pageNumber - 1) * pageSize ));
fullTextQuery.setMaxResults( ...

2. Ideas for Paging Search Result of 2 Criterias?

4. Hibernate Search pagination setMaxResults

Hibernate version: Core 3.2.6 GA Search 3.0.1 GA Name and version of the database you are using: MySQL 5.0.27 The problem is when I run the code below it returns 32 results. So far so good. But when I add pagination in the form of 'criteria.setMaxResults()' it starts to return weird results. When I set it to: 30 it returns 26 ...