elasticsearch报错Result window is too large问题解决

我在使用Elasticsearch进行search查询的过程中,出现了Result window is too large问题。
异常堆栈信息:

Caused by: org.elasticsearch.search.query.QueryPhaseExecutionException: 
Result window is too large, from + size must be less than or equal to: [10000] but was [178700]. 
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最大只支持10000的分页参数,我们这里传的是178700,远远超过这个数量。

由于时间紧,我们更改一下索引设置:

curl -XPUT http://127.0.0.1:9200/cmdb-now/_settings -d '{ "index" : { "max_result_window" : 100000000}}'

更改自己的es ip端口还有索引即可。

这种通过修改配置的方式也是治标不治本,随着es的数量越来越多的时候,还会有这个问题,这样需要进行es深度分页优化,后续更新~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值