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

在ES查询时报如下错:

Result window is too large, from + size must be less than or equal to: [10000] but was [12740]. 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  超过10000 就报错

#对orders订单 设置:

PUT orders/_settings
{
  "index":{
    "max_result_window":10000000
  }
}

 

#对所有索引设置

PUT */_settings
{
  "index":{
    "max_result_window":10000000
  }
}

你可能感兴趣的:(elasticsearch,elasticsearch,数据库,java)