MDVA-30284 Patch: Elasticsearch 7 - Limit of total fields [XXXXX] in index has been exceeded

The MDVA-30284 patch solves the issue where you receive an error message that “Limit of total fields [XXXXX] in index has been exceeded” when using Elasticsearch 7. This patch is available when the Quality Patches Tool (QPT) v.1.0.5 is installed. The patch ID is MDVA-30284.

Affected products and versions

  • The patch was designed for Adobe Commerce on cloud infrastructure 2.3.5-p2
  • Elasticsearch 7 is compatible with Adobe Commerce 2.3.5 and 2.4.x
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the magento/quality-patches package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.

Issue

The Elasticsearch fields limit is wrong resulting in the following error when executing [catalogsearch_fulltext] indexer:

Limit of total fields [xxx] in index [xxxxxx] has been exceeded

This issue occurs when you have a large number of product attributes. The issue is triggered by the way Elasticsearch calculates the field count. Sometimes when there are attributes that have fields assigned to them these fields will index as separate indexers. This results in the limit having been exceeded warning.

Steps to reproduce:

Prerequisites

  • Installed module-elasticsearch 100.3.5.
  • Elasticsearch 7 installed.
  • Set up Elasticsearch as a search backend.
  1. Create more than 1000 attributes for products.
  2. Create products for each family.
  3. Run indexer.

Expected result:

All products are available in the Elasticsearch index.

Actual result:

  1. Elasticsearch error:

    code language-none
     {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Limit
     of total fields [3000] in index [magento2_product_2_v11] has been exceeded"}],"type":"illegal_argument_exception","reason":"Limit
     of total fields [3000] in index [magento2_product_2_v11] has been exceeded"},"status":400}
    
  2. New product was not indexed.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

For info about other patches available in QPT, refer to Patches available in QPT in our developer documentation.

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a