How to increase index.max_result_window from Liferay

Issue

  • When the number of results is more than the default (10000) the following message appears on the Liferay portal logs:
    ERROR [http-nio-8080-exec-99][ElasticsearchIndexSearcher:165] java.lang.RuntimeException: org.elasticsearch.ElasticsearchStatusException: ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Result window is too large, from + size must be less than or equal to: [10000] but was [11000]. 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 setting.]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Result window is too large, from + size must be less than or equal to: [10000] but was [11000]. 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 setting.]];

    java.lang.RuntimeException: org.elasticsearch.ElasticsearchStatusException: ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Result window is too large, from + size must be less than or equal to: [10000] but was [11000]. 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 setting.]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=Result window is too large, from + size must be less than or equal to: [10000] but was [11000]. 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 setting.]];

Environment

  • Liferay DXP 7.4

Resolution

  • Configuring `index.max_result_window` in Liferay DXP can be done by following the below:

    Add the below value under Menu --> Control Panel --> System Settings --> Search --> Elasticsearch 7 --> Additional Index Configurations



    "index.max_result_window" :x

    }
  • `x` should be any value based on the portal. In the below image, it is 25000.
    Additional_Index_Configurations.png
  • Requires full reindex post configurational changes.
    Execute re-index the search indexes and spell check indexes from the Index Actions tab of Control Panel → Configuration → Search

Additional Information

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