I was looking into making pagination in my app.
at first, i used the "From", "size" options and it all worked great, until i reached the 10,000, results, which was 2 large to process as each shard process 10,010 results in order to give me the 10,001-10,010...
plus, i understood its hard to do as each search might return a different order of results (scheduling prob?) then how can we know whats the 10,007 results? so it needs to somehow save my search entirely, then go through the results of the current search with pagination ids or something like that.
So I looked farther and found out about the Scan and Scroll, so thats the way to do it!
But then i found out i can only go forward and not backward so basically thats not good enough.
so first of all, is that correct that scan and scroll can only go forward and not backwards, if i send an old scroll_id, wouldnt i get the same results as i got previously ( i didnt fully understood the scan and scroll API)??
Secondly, Is there a new/what is the best way to use pagination?
Lets say i want 10 results per pages, and i have 1,000,000 pages.
i want to go back and forth seamlessly in my app ( ES to return 10 results each request) including going backwards
Whats the best way to do so?
Thanks in advance