【Elasticsearch】Result window is too large, from + size must be less than or equal to: [10000]

引言
线上环境使用Elasticsearch分页查询数据,发现最后一页的数据查询无结果返回,查询日志,发现是Elasticsearch报错:Result window is too large, from + size must be less than or equal to: [10000]…
问题截图

【Elasticsearch】Result window is too large, from + size must be less than or equal to: [10000]_第1张图片
默认设置
查询文档,可以看到,默认设置最大查询数量是10000.

【Elasticsearch】Result window is too large, from + size must be less than or equal to: [10000]_第2张图片
解决方法
我们可以直接利用kibana工具,直接执行以下请求即可:

PUT idx_user_info/_settings
{
  "index":{
    "max_result_window":1000000
  }
}


结果返回true,修改成功,如下:

【Elasticsearch】Result window is too large, from + size must be less than or equal to: [10000]_第3张图片
再去查询10000条以后的数据就可以了

你可能感兴趣的:(大数据,elasticsearch)