Skip to content

ElasticSearch maxClauseCount is set to 1024 error

Summary

ElasticSearch is producing an error for users searching projects on a HA setup that has over 1000 projects. The customer has not set max_clause_count in their configuarion. The default is 1024.

From this elasticsearch thread, it recommends it may be an issue with the query we send.

ActionView::Template::Error ([500] {"error":{"root_cause":[{"type":"too_many_clauses","reason":
"too_many_clauses: maxClauseCount is set to 1024"}],"type":"search_phase_execution_exception",
"reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"gitlab-production",
"node":"jzvBs49-RKieq1MdDC2k7g","reason":{"type":"too_many_clauses",
"reason":"too_many_clauses: maxClauseCount is set to 1024"}}]},"status":500}):

Valery: useful reference http://george-stathis.com/2013/10/18/setting-the-booleanquery-maxclausecount-in-elasticsearch/

Ticket: https://gitlab.zendesk.com/agent/tickets/65126