If you are trying to page past the first 10000 documents in an Elasticsearch index and have not set the max_result_window setting for that index then you may receive one of the two following errors:
-
All shards failed -
Result window is too large, from + size must be less than or equal to: [10000] but was [*].
To resolve this the max_result_window setting must be set for the index that is being paged through. Use CURL or the Kibana dev console to make a PUT request to update the setting.
PUT {MY_INDEX}/_settings
{
"index" : { "max_result_window" : {MAX_VALUE}}
}
Replacing MY_INDEX with the index you wish to update the settings to and replacing MAX_VALUE with the maximum value for the result window. For the current project it was set to 50,000,000.
Note that large max_result_window values increase heap pressure on the cluster since search hits are buffered per shard, so set this no higher than your paging use case requires.