I'm implementing a REST API using Java RestHighLevelClient. The user specifies the pageNumber and the pageSize of the requested data through the REST parameters.
By default, because of the "max_result_window" limitation in ElasticSearch, I am not able to fetch more than 10'000 items in each query . I also need real time responses, so the "Scroll API" can't be an option for me(or?).
So based on what I've searched so far, search_after should be the solution for me. but on the other hand as I learnt, in order to use search_after, we should have a scenario like having 'Previous' and 'Next' buttons. While in the scenario I'm dealing with, there is no such buttons, instead the user specifically mentions the pageSize and PageNumber.
Which searching solutions(Scroll API, search_after, sliced_scrolling, etc.) is the best solution for me?
I also need a good example of how to implement search_after in Java when using RestHighLevelClient. I've spent so much time on finding an example which explains how to implement search_after, but unfortunately didn't find any.
Can search_after be used when the user specifies the pageSize and the pageNumber? if yes, how should it be implemented? If no, what should I do then?
I appreciate if someone shed a light on this matter, Thanks!