I have to query records from elastic search and display them in a grid with a page size of 1000. My index can contain above 1 million records.
I am no longer able to do paging with from + size queries because of the 10,000 limit on index.max_result_window. I don't want to increase this limit due to performance reasons.
I am using scroll api for paging and looping through records to show the desired page. e.g. if someone requests the 9th page I scroll 9 times.
It works well for intial pages but you can imagine going to the last page is very slow.
I am not an expert in elastic search, so any suggestions to improve this?
Thanks in advance
Edit 21/09/2016
Version: Elasticsearch 2.4.0
Scroll example: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html
Scroll Size: 1000
So if I have 10,00,000 records to get to the last page I have to scroll 1000 times.
Plus the user has the option to go back as well which is not supported by scroll. So I have to start scrolling from the start.
I think there should be a better way of doing this.