【问题标题】:elastic search too_many_clauses: maxClauseCount is set to 1024'弹性搜索 too_many_clauses:maxClauseCount 设置为 1024'
【发布时间】:2018-12-04 09:20:25
【问题描述】:

我正在使用 elasticserach 并收到以下错误:

'too_many_clauses: maxClauseCount 设置为 1024'

请在下面找到我的代码:

{"query": {
  "bool": {
   "must": [
    {
      "query_string": {
        "default_field": "education.title",
        "query": data
     }
   }]
  }
}

'data'是一串4500请求:

(University~ AND of~ AND Vilnius~) OR (Vilnius~ AND Higher~ AND School~) OR ... OR (Kaunas~ AND Secondary~ AND School~) (整个列表由 4500 个这样的)

任何可能的解决方案?我已经读过关于过滤会有所帮助的文章,但我仍然没有解决这个错误。

非常感谢您的帮助!

【问题讨论】:

  • 它谈到更改 .yaml,我正在寻找包括过滤器在内的解决方案,避免更改 .yaml 文件。
  • 包含'request_timeout = 30'时解决。

标签: elasticsearch full-text-search query-string


【解决方案1】:

在 Elasticsearch 5 中,“index.query.bool.max_clause_count”已被弃用。在您的 elasticsearch.yml 文件中插入“indices.query.bool.max_clause_count : n”(其中 n - 新支持的集群数)https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_settings_changes.html#_search_settings 是文档链接

更多详情请参考Elasticsearch - set max_clause_count

【讨论】:

  • 谢谢。但是,我不允许对 .yml 进行更改,因为它会影响生产。我通过过滤器寻找解决方案。还是谢谢你。
猜你喜欢
  • 1970-01-01
  • 2013-04-07
  • 2019-06-05
  • 1970-01-01
  • 2013-01-02
  • 1970-01-01
  • 1970-01-01
  • 2018-07-22
  • 1970-01-01
相关资源
最近更新 更多