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.
订阅者专属内容
Liferay企业级订阅提供超过1500篇文章的访问权限,包括最佳范例,排查和解决问题,和其他有价值的解决方案。登录以获得全部权限。
登录