开发者社区 问答 正文

Elasticsearch查询抛出"Result window is too large, from

已解决

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

展开
收起
阿里云服务支持 2022-12-12 16:18:39 1034 分享 版权
1 条回答
写回答
取消 提交回答
  • 官方回答

    当索引使用from+size方式进行深度分页查询时,默认from+size结果不能超过1万,否则会出现此错误,可通过修改index.max_result_window参数临时解决此报错:

    PUT /my_index/_settings

    {

    "index": { 
    
        "max_result_window": 20000 
    
    } 
    

    }

    提示: from+size随着分页深度的增加,将需大量集群计算资源,对集群性能影响极大,深度分页场景优先建议使用scroll或search after实现,具体请参见官方文档

    2022-12-12 16:28:55
    赞同 展开评论