Page 1 of 1

Elastic Search: failed to create query: field expansion matches too many fields, limit: 1024, got: 1399

Posted: Mon Sep 19, 2022 12:42 pm
by isscbta
In case you got this error with the elastic search:
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"failed to create query: field expansion matches too many fields, limit: 1024, got: 1399","index_uuid":"-MDwzeJbSguZI19YAsyiHQ","index":"toprc_24_searchdefault_product_idx1"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"toprc_24_searchdefault_product_idx1","node":"GGvYGRptQ2W6FQ50XO_W4w","reason":{"type":"query_shard_exception","reason":"failed to create query: field expansion matches too many fields, limit: 1024, got: 1399","index_uuid":"-MDwzeJbSguZI19YAsyiHQ","index":"toprc_24_searchdefault_product_idx1","caused_by":{"type":"illegal_argument_exception","reason":"field expansion matches too many fields, limit: 1024, got: 1399"}}}]},"status":400}
To fix this, in your SSH, as root, run:

Code: Select all

mcedit /etc/elasticsearch/elasticsearch.yml
At the end of file, add this:

Code: Select all

indices.query.bool.max_clause_count: 4096
In the end, run:

Code: Select all

systemctl restart elasticsearch