Elasticsearch
Elasticsearch is a powerful and highly scalable distributed search engine that is used by such high-volume sites as eBay, Wikipedia, and GitHub. The implementation of Elasticsearch includes both search suggestions and recommendations. For installation instructions, see Set up Elasticsearch service in our developer documentation.
Step 1: Configure search options
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
In the left panel, expand Catalog and choose Catalog underneath.
-
Expand the Catalog Search section.
-
For Search Engine, deselect the Use system value checkbox and choose the version that is installed on your server.
-
Elasticsearch (Deprecated) - Elasticsearch 2.x has reached end of life, and is now deprecated. For more information, see Elastic Product End of Life Dates.
-
Elasticsearch 5.x (Default) - Elasticsearch 5.x is scheduled for end of life. For more information, see Elastic Product End of Life Dates.
-
Elasticsearch 6.x (Recommended) - For the best performance, we recommend that you use the latest version of Elasticsearch 6.x.
For more information about using Elasticsearch versions 2.x and 5.x, see Change the Elasticsearch Client in our developer documentation.
-
-
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. This option only available for Elasticsearch or Elasticsearch 5.x Search Engines.
-
To limit the length and word count of search query text, set a value for Minimal Query Length and Maximum Query Length.
Important: 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
and300
in Magento, update the corresponding values in your search engine. -
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 of0
caches all search terms and results when entered a second time. -
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 Elasticsearch connection
Elasticsearch Connection Settings
-
Enter the Elasticsearch Server Hostname.
The default is
localhost
. -
Enter the Elasticsearch Server Port.
-
For Elasticsearch Index Prefix, enter a prefix to identify the Elasticsearch index.
Example:
Magento2
. -
To use HTTP authentication to prompt for a username and password to access Elasticsearch Server, set Enable Elasticsearch HTTPÂ Auth to
Yes
. -
For Elasticsearch Server Timeout, enter the number of seconds before the system times out.
The default value is
15
. -
To verify the configuration, click Test Connection.
Step 3: Configure suggestions and recommendations
Search suggestions and recommendations can impact server performance.
-
Set Enable Search Suggestions to
Yes
and do the following:Elasticsearch Suggestion and Recommendation Settings
-
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
.
-
-
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
.
-
-
When complete, click Save Config.