elastic search 05 -- 超过10000条无法查询

一、说明

ES 默认返回数据量为 10000 条, 当分页的 from 超过 10000 条的时候,es 就会如下报错:

Result window is too large, from + size must be less than or equal to:[10000] but was [10500]. See the scroll api for a more efficient way to requestlarge data sets. This limit can be set by changing the[index.max_result_window] index level parameter

二、解决方案

通过设置 index 参数 max_result_window 的值

PUT /index_name/_settings
{
    "index": {
        "max_result_window": "100000"
    }
}

index_name 是你的索引名

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容