We face the following issue on our Magento 2.4 store with Elasticsearch 7 and more than 7000 attributes:
Catalog Search indexer process unknown error:
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Limit of total fields [9165] in index [product_1_v2] has been exceeded"}],"type":"illegal_argument_exception","reason":"Limit of total fields [9165] in index [product_1_v2] has been exceeded"},"status":400}
How can we solve this or limit the total fields of index product_1_v2? Or does anyone know what create these fields in index [product_1_v2], so that we can check if we can reduce them.
I guess it is caused by a specific product or attribute. Is there a way to create some sort of logging, to log the specific product or attribute that is creating this error?
See also: https://github.com/magento/magento2/issues/28454
Is there a way to create a script or log, that shows all products that exceed these total files of 9169?
EDIT:
Seems that Magento has created a patch for the Cloud and Commerce version; https://support.magento.com/hc/en-us/articles/360050423891-MDVA-30284-Magento-Patch-Elasticsearch-7-Limit-of-total-fields-XXXXX-in-index-has-been-exceeded
That solved the issue.