"Result window is too large" error on Elasticsearch 6

Note: please note that Liferay has renamed its Liferay Experience Could offerings to Liferay SaaS (formerly LXC) and Liferay PaaS (formerly LXC-SM).

Issue

  • When the number of results is more than the default (10000) the following message appears on the Liferay portal logs:
Result window is too large, from + size must be less than or equal to: [10000] but was [XXXXX]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.]; 
Caused by: QueryPhaseExecutionException[Result window is too large, from + size must be less than or equal to: [10000] but was [XXXXX]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.]

Environment

  • DXP 7.0 or superior
  • Elasticsearch 6

Resolution

  • While is not normal that too many results be shown, if there is no workaround (like cleaning the page or else) the following command should be executed on the Elasticsearch server

    For Linux:
    curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -H 'Content-Type: application/json' -d '{"index.max_result_window" : "20000"}'
    For Windows:
    curl -X PUT "http://localhost:9200/_all/_settings?preserve_existing=true" -H "Content-Type:application/json" -d "{\"index.max_result_window\":\"25000\" }"
  • The 20000 value is proposed as a new value. Theoretically no performance issues will occur in values lesser than 500000. Even if that's the case, keep an eye on performance.
  • In that command a header must be specified since Elasticsearch 6 implements a strict content-type checking. More info on the link below.

Additional Information

Was this article helpful?
0 out of 0 found this helpful