错误:
trying to create too many buckets. must be less than or equal to: [100000] but was [100001]. this limit can be set by changing the [search.max_buckets] cluster level setting.
描述:
需实现的需求是以 doc中的三个参数进行分组,因为es库中存在300多万条数据,所以分组起来会有很多的bucket,而es默认桶上限是10000,所以我们需要设置相关参数,即上文说的search.max_bucket。
解决:
我用的语言是python,我就直接贴代码:
# 2147483647是2的31次方减1,最大桶数
es.cluster.put_settings(body='{"transient": {"search.max_buckets": 2147483647}}')
curl方式:
curl -H 'Content-Type: application/json' ip:port/_setting/cluster -d '{
"transient": {
"search.max_buckets": 217483647
}
}'
网友评论