Es分页查询报错:from + size must be less than or equal to: [10000] but was [10550]

wylc123 1年前 ⋅ 2075 阅读

以上错误是ElasticSearch分页搜索时出现的,这是因为ES默认支持的最大条数就是10000条,深度分页导致总条数超过10000,就会报这个错。

解决方法

调整索引的配置项index.max_result_window,如下

window下的curl工具内执行:

curl -XPUT "http://localhost:9200/*/_settings" -d "{ """index""" : { """max_result_window""" : 10000000 } }" -H "Content-Type: application/json"    -u elastic:12345678

linux下执行:

curl -XPUT "http://localhost:9200/*/_settings" -d '{ "index" : { "max_result_window" : 10000000 } }' -H "Content-Type: application/json"    -u elastic:12345678

 


相关文章推荐

全部评论: 0

    我有话说: