I am trying to use elastic search module in the play framework for searching books and I have the following method to perform the search in the controller which returns me a list of books based upon the search string entered by the user
public static void bookList(String search){
SearchResults<Book> searchResult = ElasticSearch.search(QueryBuilders.queryString(search) , Book.class);
List<Book> bookList = searchResult.objects ;
render(bookList);
}
Now I need to perform pagination on the results obtained . How do I go about doing that using the Java API ?