Impact of increasing index.max_result_window size to 10 million?

I have a scenario where I want to increase the index.max_result_window size to about 10 million. My query only cares about fetching the sort order and not the actual _source field.
Does changing the max_result_window size to > 10, 000 has any side effects on performance on ElasticSearch in non search operations like ingesting, aggregations etc?

Welcome to our community! :smiley:

It's likely to put extra pressure on your heap if you need to get that many results.
As the docs note;

See Scroll or Search After for a more efficient alternative to raising this.

Hi, thank you for the reply. However, I have a case of moving to previous pages, my concern is that search_after might become invalid if new docs are added/removed from the index.
Also elastic doesn't give a search_before functionality, so I had a hacky way of moving backwards but that requires me to explore increasing the index.max_result_window to greater than default limit of 10k.

Is there any clean way of moving backwards that you might be able to guide me with?

Thanks