ElasticSearch7翻页报错如下:
org.frameworkset.elasticsearch.ElasticSearchException: {“error”:{“root_cause”:[{“type”:”illegal_argument_exception”,”reason”:”Result window is too large, from + size must be less than or equal to: [10000] but was [916180]. 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.”}],”type”:”search_phase_execution_exception”,”reason”:”all shards failed”,”phase”:”query”,”grouped”:true,”failed_shards”:[{“shard”:0,”index”:”y_data_wq”,”node”:”ArLtSZYPTEGyIF5nvmuF2A”,”reason”:{“type”:”illegal_argument_exception”,”reason”:”Result window is too large, from + size must be less than or equal to: [10000] but was [916180]. 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.”}}],”caused_by”:{“type”:”illegal_argument_exception”,”reason”:”Result window is too large, from + size must be less than or equal to: [10000] but was [916180]. 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.”,”caused_by”:{“type”:”illegal_argument_exception”,”reason”:”Result window is too large, from + size must be less than or equal to: [10000] but was [916180]. 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.”}}},”status”:400}
怎么处理呢?
_all/_settings?preserve_existing=true
{ "max_result_window" : "2000000000" }
使用put方法执行
将所有的索引结果窗口集改为20亿,这个是已经存在的索引
新建的索引还会默认是10000,需要修改模板配置
删除模板,在原模板加入”max_result_window”:2000000000 然后重新导入模板,新匹配的索引就会是20亿
注意:在修改时,请注意中英文标点符号问题