开发者社区 问答 正文

Elastic查询抛出"Result window is too large, from + ...

已解决

Elastic查询抛出"Result window is too large, from + size must be less than or equal to: [10000]"

展开
收起
提个问题 2024-05-24 11:03:22 102 分享 版权
1 条回答
写回答
取消 提交回答
  • 开发者社区问答官方账号
    官方回答
    index.max_result_window默认值是10000。
    当索引使用from+size方式进行深度分页查询时,默认from+size结果不能超过1万,否则会出现此错误,可通过修改index.max_result_window参数临时解决此报错
    PUT /my_index/_settings 
    {
        "index": { 
            "max_result_window": 20000 
        } 
    }
    提示: from+size随着分页深度的增加,将需大量集群计算资源,对集群性能影响极大,深度分页场景优先建议使用scroll或search after实现,具体请参见官方文档
    2024-05-28 15:08:57
    赞同 展开评论