Index.max_result_window - not working


I am getting this error on latest version of elastic:

Result window is too large, from + size must be less than or equal to: [10000] but was [2039925].

so i was try to add at the elasticsearch.yml configuration file at the end this:

index.max_result_window = 5000000;

but then elastic search refuse to start with error elasticsearch[1800]: in 'reader', line 90, column 1:

and that line is the one that i was add...

I know it may be not the best way to solve this but why it doesn't accept it?

Thank you

Yaml files use colons instead of equal signs, and no semi-colons at the end. Try this:

index.max_result_window: 5000000

Do note that the setting is there for a reason. It protects your cluster from abusively large search requests. 5,000,000 is certainly an abusively large request and will likely hurt the performance of your cluster, potentially even crashing it.

If you need large result sets, you should scan scroll over the data instead.


it doesn't work....

[WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: node settings must not contain any index level settings

This is an index setting not a node setting.

How can i increase it then?

Using the update index settings API.

1 Like

something like this?

curl -XPUT "http://localhost:9200/my_index/_settings" -d '{ "index" : { "max_result_window" : 5000000 } }'

if yes it will survive elastic restarts/reinstallations or system restarts?

Thank you



It will survive a restart, yes.


But I don't think you should do that. You are going to have memory issues, and super slow response time if you search fro something like:

"from": 4999990,
"size": 10

More at Index modules | Elasticsearch Guide [8.11] | Elastic


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.