es查询超过10000条数据报错

es未作任何修改,查询超过10000条程序报错

Elasticsearch exception [type=illegal_argument_exception, reason=Result window is too large, from + size must be less than or equal to: [10000] but was [126280]. 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 setting.]

解决方案,修改max_result_window限制

put方式调用es,修改限制

{
"index":{
"max_result_window":2000000
}
}

image.png

你可能感兴趣的:(es查询超过10000条数据报错)