解决方案一

elasticsearch默认输出最多一万条
查询第10001条数据开始就会报错:Result window is too large, from + size must be less than or equal to
但是很多时候10000数据不能满足项目的需求,所以我们就要解除这个限制。
ip:port为es的ip和端口
curl -H "Content-Type: application/json" -XPUT http://ip:port/_settings -d '{ "index" : { "max_result_window" : 100000000}}'

如果java调用es client还需要加

searchSourceBuilder.trackTotalHits(true);

 解决方案二

创建索引时设置

"settings":{
    "index":{
        "max_result_window":1000000
   } 
}

相关文章:

  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2022-12-23
  • 2021-08-11
猜你喜欢
  • 2022-02-02
  • 2021-11-26
  • 2021-09-06
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案