ES查询上万条数据的时候报错问题解决方案

在使用ES查询的时候会与到一下报错,不要着急,这个是由于你的数据超过1W了 。此时应该为此高兴,说明ES可以用,并且查询速度很快。

string(1460) “{“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 [10005]. 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”:“books”,“node”:“FfUcBY-oQOiBqTGEe45AIA”,“reason”:{“type”:“illegal_argument_exception”,“reason”:“Result window is too large, from + size must be less than or equal to: [10000] but was [10005]. 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 [10005]. 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 [10005]. 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}”

接下来我们解决这个问题:

  1. 先启动 ES_header (http://localhost:9100/) ,能看到下面的页面,当然其他的管理工具也可以。
    在这里插入图片描述
    2、先关闭你使用的 索引 ,如下图

在这里插入图片描述
3、进入 复合查询中
在这里插入图片描述
直接复制即可,注意图中提到的。

**books/_settings?preserve_existing=true

{
“max_result_window”: “9000000”
}**

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值