Which is better scrolls or search_after in elasticsearch to simulate random pagination? Which is better scrolls or search_after in elasticsearch to simulate random pagination? elasticsearch elasticsearch

Which is better scrolls or search_after in elasticsearch to simulate random pagination?


If you don't have memory concerns, then the simplest option is to increase the index setting index.max_result_window from 10000 to the number you require.

See https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html#dynamic-index-settings


Scroll API is best option for pagination of huge records. I have implemented scroll API pagination for more than 4 lakhs records.