参考链接
https://blog.youkuaiyun.com/m0_38130105/article/details/95494386
es 报错:
Result window is too large, from + size must be less than or equal to: [10000] but was [415930]. 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
es分页查询是,页面+size 的大小默认是10000,超过此限制就会报错
解决方案:
- 打开项目的索引库地址,将要调整的索引库(indexname) 先关闭
- 概览 -》 对应索引库(indexname) -》 动作 -》关闭
- 在复合索引查询页输入 indexname/_settings?preserve_existing=true { "max_result_window" : "10000000"}
- indexname 是要调整的索引库名
- preserve_existing=true 开启查询限制
- 提交方式一定要改成 PUT
- 10000000 设置最大访问页数,可以根据实际情况进行调整
设置成功后,需要重新开启索引库(indexname)
查询索引库最大查询限制
- liveindex/_settings GET
开启了查询限制后,会对服务造成很大的压力,每次查询页数太大,所以不建议开启该选项
- 恢复默认设置
- credit_trace_data/_settings?preserve_existing=false
- PUT 提交