I am using Hibernate Fulltext search. I am currently using:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
<version>4.5.1.Final</version>
</dependency>
I am able to search all right. The question I have is this: How can I paginate my results? Is there any way I can get say 50 results first and then make calls when next page is requested for the next 50 results?
One way I'm thinking of would be to simply get the max ID and then start next search from Max+1 position, assuming ID's are generated in auto incremental order. But I think there must be more elegant approach.