3 Easy Steps To Configure Magento 2 ElasticSearch

In this article, we will show you a detailed guide to configure Magento 2 ElasticSearch – a robust and highly scalable catalog search solution that helps you optimize the search and retrieval function on your Magento 2 stores

For any Magento 2 stores, the search is undoubtedly one of the most important functions. An effective search can help buyers easily find their needed products on the store, this provides better customer experience and stimulated purchases.

Therefore, it’s essential to enhance the search feature in Magento 2 stores, and applying Elasticsearch is one of the best ways to do that.

Let’s explore!

A Complete Magento 2 Elasticsearch Tutorial

#Step 1: Configure search options

  • From the Admin sidebar, go to Stores SettingsConfiguration.
  • In the panel on the left, choose CatalogCatalog. 
  • Expand the Catalog Search section.
elasticsearch-magento 2

READ NOW if you are also interested >>> Magento Default Search Vs Advanced Search And Fast Autocomplete

  • In Minimum Query Length: enter the query length at which the store starts using the Elasticsearch.
  • In Maximum Query Length: enter query length which the Magento 2 Elasticsearch is disabled if exceeded.
  • In Number of top search results to cache: enter the number of popular searches to store for faster response.
  • In Enable EAV Indexer, set Yes to improve indexation speed.
  • In the Search Engine, clear the Use system value checkbox and select the version of Elasticsearch which is installed on your server:
    • Magento Elasticsearch (Deprecated) – Elasticsearch 2.0+ has reached the end of life.
    • Elasticsearch 5.0+ (Default) – Elasticsearch 5.0+ is about to end of life.
    • Elasticsearch 6.0+ (Recommended) – For the best performance, you should use the latest version: Elasticsearch 6.0+.
  • In Autocomplete Limit: enter the maximum number of search results displayed for search autocomplete.

#Step 2: configure Magento

Elasticsearch connection


  • Enter the Elasticsearch Server Hostname. The default is localhost
  • Enter the Elasticsearch Server Port.
  • Enter a prefix in the Elasticsearch Index Prefix field to determine the Elasticsearch index.
  • In the Enable Elasticsearch HTTP Auth:  select Yes to use HTTP authentication. This function suggests a username and password access Magento 2 Elasticsearch Server.
  • In Elasticsearch Server Timeout: enter the number of seconds before the system times out. The default number is 15.
  • Click to the Test Connection button to verify the configuration.

#Step 3: Configure suggestions and recommendations

  • Set Enable Search Suggestions to Yes
    • In the Search Suggestions Count: enter the number of search suggestions to offer.
    • In the Show Results for Each Suggestion: set Yes to show the number of results found for each suggestion.
  • In the Enable Search Recommendations,  set Yes to offer recommendations.
    • In the Search Recommendation Count field, 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”.
  • Click the Save Config button. 

Sum It Up

We have shown a detailed guide to help you configure Magento 2 ElasticSearch. We hope that it is easy for you to follow. If you are not clear on anything,  leave a comment below so that we can help!

EXPLORE NOW more built-in solutions from BSS Commerce

We are one of the leading Magento extension providers and web development services in the world. With experienced and certified Magento developers, we commit to bring high-quality products and services to optimize our business effectively. Let us know about your problems. We are willing to support you every time.

Write A Comment


( 1 ) Comment

  • Hadil

    thank you very nice website article