首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Result window is too large, from + size must be less than or equal to: [10000] but was [10025

Result window is too large, from + size must be less than or equal to: [10000] but was [10025

作者头像
IT云清
发布2019-01-22 11:23:54
2.4K0
发布2019-01-22 11:23:54
举报
文章被收录于专栏:IT云清IT云清
使用elasticsearch做分页查询时,当查询记录超过10000时,会报如下错误:
Result window is too large, from + size must be less than or equal to: [10000] but was [10025].
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 parameter.
查阅文档可知,默认只能查询到10000:
index.max_result_window
The maximum value of from + size for searches to this index.
 Defaults to 10000. Search requests take heap memory and time proportional to from + size and this limits that memory.
See Scroll or Search After for a more efficient alternative to raising this.
解决方法:
修改一下设置,把这个设置到自己想要的极限即可,我这里设置1000000:
PUT policy_document/_settings
{
  "index":{
    "max_result_window":1000000
  }
}

修改成功后返回:

{
  "acknowledged": true
}

然后再去查询就可以了。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018年05月29日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 使用elasticsearch做分页查询时,当查询记录超过10000时,会报如下错误:
  • 查阅文档可知,默认只能查询到10000:
  • 解决方法:
  • 修改一下设置,把这个设置到自己想要的极限即可,我这里设置1000000:
相关产品与服务
Elasticsearch Service
腾讯云 Elasticsearch Service(ES)是云端全托管海量数据检索分析服务,拥有高性能自研内核,集成X-Pack。ES 支持通过自治索引、存算分离、集群巡检等特性轻松管理集群,也支持免运维、自动弹性、按需使用的 Serverless 模式。使用 ES 您可以高效构建信息检索、日志分析、运维监控等服务,它独特的向量检索还可助您构建基于语义、图像的AI深度应用。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档