Elasticsearch设置查询数量的限制
- 查阅官方文档
https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html
- The maximum value of from + size for searches to this index. Defaults to 10000. Search requests take heap memory and time proportional to from + size and this limits that memory
PUT /索引名/_settings
{
"index.max_result_window": "10000" # 默认为10000,可以设置为任何大小
}
注: max_result_window为from + size的最大值