简体   繁体   English

ElasticSearch maxClauseCount设置为1024

[英]ElasticSearch maxClauseCount is set to 1024

I'm using the elasticsearch-rails gem in Rails 5 and I am trying to increase the max_clause_count . 我在Rails 5中使用了elasticsearch-rails gem,并且试图增加max_clause_count I'm using version 7.3 of ElasticSearch. 我正在使用7.3版的ElasticSearch。

In my elasticsearch.yml file I have added the following code: 在我的elasticsearch.yml文件中,添加了以下代码:

indices.query.bool.max_clause_count: 4096

In my initializer, I load the configs like so: 在初始化程序中,我像这样加载配置:

config = {
  host: "http://localhost:9200",
  transport_options: {
    request: { timeout: 200 }
  }

}


if File.exists?("config/elasticsearch.yml")
  config.merge!(YAML.load_file("config/elasticsearch.yml").symbolize_keys)
end

Elasticsearch::Model.client = Elasticsearch::Client.new(config)

I can still reproduce this error with one of my queries that is rather long and when I do, after loading the configs above I still get the error: 我仍然可以使用较长的查询之一重现此错误,当我这样做时,在加载上述配置后,我仍然会收到错误:

{"type":"too_many_clauses","reason":"maxClauseCount is set to 1024"}

printing the config to the terminal I get this output: 打印配置到终端我得到以下输出:

{:host=>"http://localhost:9200", :transport_options=>{:request=>{:timeout=>200}}, :"indices.query.bool.max_clause_count"=>4096}

I hate to ask this but just in case this is the issue, this is a static Lucene setting, it can only be set in the Elasticsearch config file and get picked up at startup. 我不想问这个问题,但万一这是问题,这是静态的Lucene设置,只能在Elasticsearch配置文件中设置并在启动时获取。 Did you restart your cluster after making the config change? 更改配置后,您是否重新启动了集群?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM