Elasticsearch - 设置 max_clause_count [英] Elasticsearch - set max_clause_count
问题描述
我在elasticsearch中有一个相当大的术语查询,所以我得到too_many_clauses: maxClauseCount 设置为 1024
I have a pretty big terms query in elasticsearch, so I get
too_many_clauses: maxClauseCount is set to 1024
我尝试在 elasticsearch.yml 中增加它
I tried increasing it in the elasticsearch.yml by
index:
query:
bool:
max_clause_count: 10240
并通过
curl -XPUT "http://localhost:9200/plastic/_settings" -d '{ "index" : { "max_clause_count" : 10000 } }'
但没有任何效果.我的索引名为塑料.
but nothing worked. My index is named plastic.
推荐答案
背景
注意:此答案中给出的建议仅适用于低于 5.5 的 Elasticsearch 版本.所描述的方法引用了一个最终在 5.5 中被删除的属性.
Background
NOTE: The advice given in this answer only applies to versions of Elasticsearch below 5.5. The method described references a property that was eventually removed in 5.5.
设置 index.query.bool.max_clause_count
已被删除.为了设置布尔子句的最大数量应该使用 indices.query.bool.max_clause_count
代替.
Search Settings
The setting
index.query.bool.max_clause_count
has been removed. In order to set the maximum number of boolean clausesindices.query.bool.max_clause_count
should be used instead.
- 参考 - 5.0 中的重大更改 » 设置更改
添加以下内容:
index.query.bool.max_clause_count: 10240
到集群的每个节点上的文件elasticsearch.yml
,然后当然要重启节点(配置文件中的任何更改都需要重启).
To the file elasticsearch.yml
on each node of the cluster, then of course, restart the nodes (any change in the config file needs a restart).
这篇关于Elasticsearch - 设置 max_clause_count的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!