我正在使用ES 5.2.0,在执行某些查询时出现以下异常:
Caused by: NotSerializableExceptionWrapper[too_many_clauses: maxClauseCount is set to 1024]
at org.apache.lucene.search.BooleanQuery$Builder.add(BooleanQuery.java:125)
at org.elasticsearch.index.query.BoolQueryBuilder.addBooleanClauses(BoolQueryBuilder.java:449)
at org.elasticsearch.index.query.BoolQueryBuilder.doToQuery(BoolQueryBuilder.java:418)
为了解决这个问题。我正在尝试通过运行以下查询来更改“indices.query.bool.max_clause_count”的值
请求:
PUT http://localhost:9200/_all/_settings?preserve_existing=true
{"indices.query.bool.max_clause_count" : "100000"}
响应:
{
"error": {
"root_cause": [
{
"type": "remote_transport_exception",
"reason": "[06LrSZC][localhost:9300][indices:admin/settings/update]"
}
],
"type": "illegal_argument_exception",
"reason": "unknown setting [index.indices.query.bool.max_clause_count] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
},
"status": 400
}
我曾经解决过的引用资料却无法:
https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_settings_changes.html#_search_settings
https://discuss.elastic.co/t/5-0-0-alpha2-how-to-set-index-query-bool-max-clause-count/49816
https://github.com/elastic/elasticsearch/pull/18341
请让我知道执行此操作的正确请求JSON。
最佳答案
indices.query.bool.max_clause_count
是静态设置,因此您应该在elasticsearch群集的每个节点的elasticsearch.yml
文件中进行设置。您必须重新启动集群。
使用以下行更新您的elasticsearch.yml
文件:
indices.query.bool.max_clause_count: 100000
注意:仅动态设置可以使用API更新
关于elasticsearch - 在 Elasticsearch 中无法更改 “maxClauseCount”值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43916076/