I am trying to do a search with some criteria
Code:
FullTextQuery fullTextQuery = fullTextSession.createFullTextQuery(finalQuery, KnowledgeBaseSolution.class).setCriteriaQuery(criteria);
and then page it
Code:
//Gives me around 700 results
result.setResultCount(fullTextQuery.getResultSize());
//Some pages are empty
fullTextQuery.setFirstResult(( (pageNumber - 1) * pageSize ));
fullTextQuery.setMaxResults( pageSize );
result.setResults(fullTextQuery.list());
I suspect Lucene return full result of the full text search without taking the criteria into account and then hibernate search applies the criteria after, therefore some page are empty (after filtering by criteria)
What is proper way to do fullTextSearch with some criteria, is it possible to apply the criteria before the lucene search?
Or do I have to use pure Lucene (if so what's the point of Hibernate Search?)
(I found this post, is this still true that paging is not supported?
viewtopic.php?t=980849&highlight=hibernate+search+pagination)
Thanks in advance