For more details see the Elastic Search for Magento 2 extension page.
Elastic Search for Magento 2 is an advanced tool to provide your store with optimized search performance and highly relevant search results.
Please, consider that there are three main entities, which constitutes the extension's work:
Elasticsearch is provided in the various packages formats. The most commonly servers work on Debian-based or RPM-based systems.
Debian Package can be used to install Elasticsearch on any Debian-based system such as Debian and Ubuntu. You can install and run the Elasticsearch Debian package with the following:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.deb wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.deb.sha512 shasum -a 512 -c elasticsearch-6.3.0.deb.sha512 sudo dpkg -i elasticsearch-6.3.0.deb sudo update-rc.d elasticsearch defaults 95 10 sudo -i service elasticsearch start
It can be used to install Elasticsearch on any RPM-based system such as OpenSuSE, SLES, Centos, Red Hat, and Oracle Enterprise. The RPM for Elasticsearch v6.3.0 can be downloaded from the website and installed with the following commands:
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.rpm wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.rpm.sha512 shasum -a 512 -c elasticsearch-6.3.0.rpm.sha512 sudo rpm --install elasticsearch-6.3.0.rpm sudo chkconfig --add elasticsearch sudo -i service elasticsearch start
The solution is for Magento 2 EE 2.1.X. For 2.2.X and above no additional actions required.
As Magento 2 Enterprise Edition utilizes its own ElasticSearch module, you will need to implement certain modifications before installing the ElasticSearch by Amasty.
Please, replace the line
in the following files:
Then, execute the following:
composer clearcache composer require elasticsearch/elasticsearch ~5.1
Now, the installation process should be completed successfully.
To manage a connection to Elastic Search, go to Admin Panel > Stores > Configuration > Elastic Search > Connection
To enable the extension, in the Search Engine field, select the Amasty ElasticSearch. Alternatively, select MySQL, to disable the extension.
Elasticsearch Server Hostname - Specify a host name or IP address of a machine that runs Elasticsearch. (localhost or 127.0.0.1 by default).Get this value via Magento Cloud.
Elasticsearch Server Port - Set the Elasticsearch web server proxy port. In our example, the port is 9200.Get this value via Magento Cloud.
Elasticsearch Index Prefix - Specify a particular prefix for each store that you employ elastic search for.
Enable Elasticsearch HTTP Auth - Select Yes, if you have enabled authentication for your Elasticsearch server. Specify a user name and password in the pop-up fields.
Elasticsearch Server Timeout - Set the timeout.
Click Test Connection.
To configure Elastic Search functionality, go to Admin Panel → Stores → Configuration → Elastic Search → Catalog
Wildcard Type - Specify the type of the autocomplete suggestion - the part of a word which will be auto-completed. Three types are available to set:
Enable Wildcard After - Specify a number of symbols, after which an autocomplete suggestion will be applied.
Enable Spell Correction - Specify a number of symbols, after which a spell correction will be applied.
Max Number of Search Results - Specify the maximum number of items in the search results.
Allow Special Characters - Enable a long-tail search. The search will include the hyphens, slashes and any symbols. The feature provides precise results when searching by SKU and MPN (manufacturer part numbers).
To add a product attribute to a search query configuration, please go to Admin Panel > Stores > Attributes > Product > Select a needed product attribute > click a tab Storefront Properties > Enable Use in Search
Specify the search type preferences for each product attribute:
Product Name attribute with Wildcard vs with Spell Correction
Think over how would you like the keywords in a search query to be combined for each product attribute.
How it works?
For instance, a customer searches your web store looking for a velvet jacket. As you specify a boolean type for a Product Name attribute:
To keep index small by specifying the list of words to be ignored by search engine, go to Admin Panel → System → Manage Stop Words.
On the grid the list of all stop words is displayed. Easily Edit or Delete each stop word via Action column.
Click Add New Stop Word. Specify a Stop Word and Store View for the word to be applied.
With the extension it is also possible to Import Stop Words.
To build a dictionary of synonyms, navigate to Admin Panel → System → Manage Synonyms.
Click Add New Synonym to input a group of words that will be regarded equally by a search logic. Separate them with commas.
Select a Store View.
You can switch to edit an entry by clicking Select in Action column on the synonyms' grid.
As an alternative, Import a CSV file with synonyms dictionary.
To manage boost rules, navigate to Admin Panel → System → Search Page Relevance Rules.
In the Action column (Select drop-down) choose Edit, to edit the existing rules.
Click Add New Rule to specify search and return conditions for a new promo rule.
Specify the name for a relevance rule - input Title. Note, that it is used mainly for admin.
Enabled - Enable or disable a rule with a toggle.
Website - Specify the particular stores, where you want the rule to be applied. Select from drop-down a needed store.
Activate - Set the dates (from-to), use a pop-up calendar or input directly with numbers.
Product Relevance - There are two modes available to work with relevance rules: Increase by and Decrease by:
Specify to what extend you want to boost or lower the products by setting a number from 1 to 100.
Conditions - Set the conditions, according to your marketing needs.
Go to Admin Panel → Stores → Configuration → Advanced Search, to configure the advanced search features.
Expand the General tab.
Popup width (px) - indicate the width of the autocomplete popup window to make it fit in with other page elements. Recommended value for horizontal view is 900. To get vertical view, please enter 700 and lower.
Min characters - specify the minimal number of characters that customers should type in to trigger the search process. By default, the number is three.
Enable Redirect from 404 to Search Results - if the option is enabled, customer will be redirected to the store search results of the broken URL text instead of the '404 Not Found' page. Custom URL Key for Default Search Results Page - enable to set SEO-friendly short URLs. URL will look 'search/yellow' instead of 'catalogsearch/results/q=yellow'.
Search Results Page URL Key - specify the URL alias for the search results' page.Please do not use 'catalogsearch' as URL Key value.
Enable Tabs on the Search Result Page - set to Yes to enable the tabs that sort search results by Category, CMS, and Landing on the search results page.
Include any available product attributes in search algorithm. For each attribute, you can set a priority (weight).
Click Add to create a new attribute. Set its Weight from 1 to 10 - select from a drop-down. Use the bin icon in the Action column to delete attributes in one click.
Expand this tab to configure products display in a popup window.
Enabled - set to Yes to enable search in products and display search results in the autocomplete popup.
Title - customize the title for the products block.
Position - specify products block position in the popup. This setting is ignored for the horizontal popup window.
Max Results - set the max number of displayed results.
Name Length - indicate the max number of characters of a product name that will be displayed in a popup window.
Short Description Length - set the number of characters for a product short description to be shown in a search window.
Show Reviews - enable reviews display in the autocomplete popup to help customers make the purchase decision much faster.
Enable 'Add to Cart' button - set to Yes to show Add to cart button in the popup to let customers purchase necessary products right away.
Redirect to Product Page - enable this option to redirect in case there is only one search result available. Show 'Out of Stock' Products Last - enable a feature to place the out-of-stock items last in the search results.
Enabled - enable the display of the Popular Searches block.
Show on First Click - set the option to Yes to let customers see the Popular Searches block in the autocomplete popup once they click on the quick search field.
Title - specify the title of the block.
Position - set the position for Popular searches block.
Max Results - set the maximal number of popular search results that will be displayed in the search autocomplete popup.
Enabled - select Yes to display the Recent Searches block.
Show on First Click - set the option to Yes to let customers see the Recent Searches block in the autocomplete popup once they click on the quick search field.
Specify the Title, Position and Max Results to be displayed.
Enabled - set to Yes to enable search by blog pages and to display a blog section in the search window popup to help store visitors find the required content throughout your corporate blog.
Title - input a name for the section in the search popup, where the blog results will be displayed.
Also specify the Position, Max Results.
Set Content Heading Length and Content Length to be displayed to make your search autocomplete window look informative and clear.
Enable to display a Brand section in the search window popup.
Specify the Title, Position, Max Results, Content Heading Length and Content Length for Brands block.
Enable the option to let the extension search among category attributes and display the results in the autocomplete popup.
Specify Categories block Title, Position and the max number of displayed Results.
Name Length - indicate the number of characters of a category title that will be displayed in a popup window.
Description Length - set the number of characters for a product short description to be shown.
Display Full Category Path - set to Yes to show full path to the results displayed in the popup.
Enable search on CMS pages to provide customers with detailed search results.
Specify the Title, Position and the Max Results.
Also set the maximal number of characters for Content Heading and Content that will be shown.
Enable search landing pages in the popup, specify the Title, Position and the Max Results. Set the maximal number of characters for Content Heading and Content that will be shown is the search popup.
Enable this option to customize popup design.
Set colors for a Border, Hover, Highlight, Background, Text and Hover Text using convenient color picker tool.
The Advanced Search extension allows to maximize profits by analyzing visitors' searching activity and the data gained.
To see the Search Analytics dashboards, go to Admin Panel → Reports → Search Analytics.
Here you can see the next values: total searches, unique searches, the number of users and users’ engagement.
Easily check customers’ demand in the Most Wanted Search Terms and Recent Activity blocks.
To configure the indexing of your catalog, go to System → Tools → Index Management
To prevent search engines (Google, Bing, Yahoo, etc.) from needlessly indexing Magento catalog search results page(s) and advanced search results page(s) we added the code to app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/local.xml.
Find out how to install the Elastic Search extension for Magento 2 via Composer.