elasticsearch采用from+size分页时,数据量大于1W会报错

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

解决方法

1
2
3
4
# 所有索引
curl -X PUT -H 'Content-Type: application/json' 172.24.0.171:9200/_all/_settings -d '{ "index.max_result_window" :"100000"}'
# 指定product_order索引
curl -X PUT -H 'Content-Type: application/json' 172.24.0.171:9200/product_order/_settings -d '{ "index.max_result_window" :"100000"}'