Configure catalog search

There are two variations of the Catalog Search configuration. The first method describes the available settings when Live Search is installed. The second method describes the configuration settings for native Adobe Commerce with OpenSearch.

NOTE
For cloud infrastructure projects, see additional instructions in the Commerce on Cloud Infrastructure Guide.
  1. On the Admin sidebar, go to Stores > Settings > Configuration.

  2. In the left panel, expand Catalog and choose Catalog underneath.

  3. Expand Expansion selector the Catalog Search section.

    Catalog Search for Live Search {width="600" modal="regular"}

    For a detailed list of these options, see Adobe Commerce with Live Search in the Configuration Reference.

  4. To limit the length and word count of search query text, set a value for Minimal Query Length and Maximum Query Length.

  5. To limit the amount of popular search results to cache for faster responses, set an amount for Number of top search results to cache.

    The default value is 100. Entering a value of 0 caches all search terms and results when entered a second time.

  6. To change the maximum number of lines that are available for returned results in the storefront pop over, enter a different Autocomplete Limit value.

    Restricting the number of lines improves the performance of searches and reduces the size of the returned list. The default value is 8 lines.

Method 2: Commerce with OpenSearch

IMPORTANT
  • Due to the Elasticsearch 7 end-of-support announcement for August 2023, it is recommended that all Adobe Commerce customers migrate to the OpenSearch 2.x search engine. For information about migrating your search engine during product upgrade, see Migrating to OpenSearch in the Upgrade Guide.
  • In versions 2.4.4 and 2.4.3-p2, all fields labeled Elasticsearch also apply to OpenSearch. When support for Elasticsearch 8.x was introduced in version 2.4.6, new labels were created to distinguish between Elasticsearch and OpenSearch configurations. However, the configuration options for both are the same.

Step 1: Configure general search options

NOTE
With OpenSearch and ElasticSearch, there is no out-of-the-box support for search by the suffix. For example, search by SKU may not return the expected result if the keyword contains only the end part of the SKU.
  1. On the Admin sidebar, go to Stores > Settings > Configuration.

  2. In the left panel, expand Catalog and choose Catalog underneath.

  3. Expand Expansion selector the Catalog Search section.

    Search engine settings {modal="regular"}

    For more information about these options, see Adobe Commerce with native search in the Configuration Reference.

  4. To limit the length and word count of search query text, set a value for Minimal Query Length and Maximum Query Length.

    note important
    IMPORTANT
    The value set for this minimum and maximum range must be compatible with the corresponding range set in your search engine configuration. For example, if you set these values to 2 and 300 in Commerce, update the corresponding values in your search engine.
  5. To limit the amount of popular search results to cache for faster responses, set an amount for Number of top search results to cache.

    The default value is 100. Entering a value of 0 caches all search terms and results when entered a second time.

  6. If you want to enable or disable the Product EAV indexer, set the Enable EAV Indexer.

    This feature improves indexation speed and restricts the indexer from use by third-party extensions.

  7. To limit the maximum number of search results to display for search autocomplete, set an amount for Autocomplete Limit.

    Restricting this amount increases performance of searches and reduces the displayed list size. The default value is 8.

Step 2: Configure the OpenSearch connection

IMPORTANT
The Search Engine, OpenSearch Server Hostname, OpenSearch Server Port, OpenSearch Index Prefix, Enable OpenSearch HTTP Auth, and OpenSearch Server Timeout fields were configured when Commerce was installed or upgraded. These values should be changed only when upgrading or modifying OpenSearch.
  1. For Search Engine, select OpenSearch.

  2. For OpenSearch Server Hostname, accept the default value that was configured when Commerce was installed.

  3. For OpenSearch Server Port, accept the default value that was configured when Commerce was installed.

    In this example, the default value is 9200.

  4. For OpenSearch Index Prefix, enter a prefix to identify the Elasticsearch index.

    The default value is magento2.

  5. To use HTTP authentication to prompt for a username and password to access the OpenSearch server, set Enable OpenSearch HTTP Auth to Yes.

  6. For OpenSearch Server Timeout, enter the number of seconds before the system times out.

    The default value is 15.

  7. To verify the configuration, click Test Connection.

Step 3: Configure suggestions and recommendations

NOTE
Search suggestions and recommendations can impact server performance.
  1. To offer recommendations, set Enable Search Recommendations to Yes and do the following:

    • For Search Recommendation Count, enter the number of recommendations to offer.

    • To show the number of results found for each recommendation, set Show Results Count for Each Recommendation to Yes.

  2. Set Enable Search Suggestions to Yes and do the following:

    • For Search Suggestions Count, enter the number of search suggestions to offer.

    • To show the number of results found for each suggestion, set Show Results for Each Suggestion to Yes.

Step 4: Configure minimum terms to match

To control the minimum number of terms from your query that the search results should match for return, specify a value for Minimum Terms to Match. Specifying this value ensures optimal results relevancy for shoppers. For a list of accepted values, see minimum_should_match parameter in the OpenSearch documentation.

When complete, click Save Config.

recommendation-more-help
af062d56-f22c-4537-813d-bedf8b92a071