環境:ElasticSearch7.6.2
報這個錯誤 先看看索引字段 的mapping,然后查看 ElasticSearch 后台運行日志。
如果報這個錯誤
bug Trying to create too many buckets. Must be less than or equal to: [10000] but was [10001]. This limit can be set by changing the [search.max_buckets] cluster level setting.
這是6.x版本才有的特性,目的:限制大批量聚合操作,規避性能風險。
解決方案:setting里設置:search.max_buckets
curl方式 :
curl --user 用戶名:密碼 -XPUT 'http://192.168.0.7:9200/_cluster/settings' -H 'Content-Type: application/json' -d'{"persistent": { "search.max_buckets": 217483647}}'