How To Configure Elasticseach in Magento 2
Elasticsearch is a robust and highly scalable catalog search solution which is used by high-volume sites such as eBay, Wikipedia, and GitHub. With the support of Magento 2 Elasticsearch, store admins can implement both search suggestions and recommendations, giving a better customer experience to make extra sales.
In this article, you will be instructed to configure Elasticsearch in Magento 2.
Tip: Download Elasticsearch by Mavenbird to enable any search, auto-corrected spelling, synonym searches, behavior tracking, and more.
3 steps to configure Elasticsearch in Magento 2:
Step 1: Configure Search Options
- From the Admin sidebar, select Stores. Then under Settings, select Configuration.
- In the panel on the left of the screen, under CATALOG, select Catalog.
- Click to Catalog Search to expand this section.
- In the Search Engine field, clear the Use system value checkbox and select the version of Elasticsearch that is installed on your server.
- Elaticsearch (Deprecated) Elasticsearch 2.0+ has reached the end of life and is considered as inactive development or maintenance.
- Elaticsearch 5.0+ (Default) Elasticsearch 5.0+ is planned for end of life.
- Elasticsearch 6.0+ (Recommended) For the best performance, we highly recommend that you use the latest version of Elasticsearch 6.0+.
- In the Enable EAV Indexer field, select Yes/ No option to enable/ disable the Product EAV indexer. This functionality increases indexation speed and keeps the indexer from being used by 3rd party extensions. This feature does not display for the system value Search Engines.
- To restrict the length and word count of search query text, set the Minimal Query Length and Maximum Query Length.
Note: The value set for this minimum and maximum range must be compatible with the corresponding range set in your Elasticsearch search engine configurations. For example, if you set these values to 2 and 300 in Magento, update the values in your search engine.
- To restrict the number of popular search results to cache for faster responses, enter a number on Number of top search results to cache field.
- To restrict the maximum number of search results to show for search autocomplete, set an amount for Autocomplete Limit. Limiting this amount enhances the performance of searches and cut down the displayed list size. The default number is 8.
Step 2: Configure the 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. For instance: Magento2.
- In the Enable Elasticsearch HTTP Auth field, select Yes option to use HTTP authentication to suggest a username and password access Elasticsearch Server.
- Enter the number of seconds before the system times out to the Elasticsearch Server Timeout field. The default number is 15.
- To verify the configuration, click the Test Connection button.
Step 3: Configure Suggestions and Recommendations
Search suggestions and recommendations can affect server performance
- In the Enable Search Suggestions field, choose the Yes option. Then, take the following actions:
- Fill the Search Suggestions Count field with the number of search suggestions to offer.
- In the Show Results for Each Suggestion field, select Yes option to display the number of results found for each suggestion.
- In the Enable Search Recommendations field, select Yes option to offer recommendations.
- Fill the Search Recommendation Count field with the number of recommendations to offer.
- In the Show Results Count for Each Recommendation field, select Yes to display the number of results found for each recommendation.
- When you finish your configuration, click to the Save Config button.
Conclusion
The detailed instructions above hopefully gives you ideas on how to configure Elasticsearch in Magento 2. If you have questions on any steps, don’t hesitate to contact us.