简体   繁体   中英

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 . I'm using version 7.3 of ElasticSearch.

In my elasticsearch.yml file I have added the following code:

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. Did you restart your cluster after making the config change?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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