ES报错Result window is too large, from + size must be less than or equal to: [10000] | 少将全栈
  • 欢迎访问少将全栈,学会感恩,乐于付出,珍惜缘份,成就彼此、推荐使用最新版火狐浏览器和Chrome浏览器访问本网站。
  • 吐槽,投稿,删稿,交个朋友
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏少将全栈吧

ES报错Result window is too large, from + size must be less than or equal to: [10000]

开发笔记 admin 5年前 (2019-12-17) 6785次浏览 已收录 扫描二维码

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方法执行


ES报错Result window is too large, from + size must be less than or equal to: [10000]

将所有的索引结果窗口集改为20亿,这个是已经存在的索引

新建的索引还会默认是10000,需要修改模板配置

删除模板,在原模板加入”max_result_window”:2000000000 然后重新导入模板,新匹配的索引就会是20亿

注意:在修改时,请注意中英文标点符号问题

喜欢 (5)
[🍬谢谢你请我吃糖果🍬🍬~]
分享 (0)
关于作者:
少将,关注Web全栈开发、项目管理,持续不断的学习、努力成为一个更棒的开发,做最好的自己,让世界因你不同。