With the help of this extension, you can integrate Elasticsearch engine into your Magento 2 web store. Elasticsearch is a highly scalable open-source full-text search engine. It allows you to store, search, and analyze big volumes of data very￼ quickly. It is the fastest search engine that returns the results of the entered query in real time.
Note: Before installing this module, Elastic Search Engine must be installed on the system and must be running.
Features of Magento 2 Elasticsearch
- Admin can easily replace MySQL search engine with the elastic search engine.
- Admin can easily update products, categories and cms pages data to the elastic server.
- The data is stored on the elastic server according to the Index Type.
- The Admin can set Cron for Index Management on a daily, weekly or monthly basis so that if any changes are made, those changes will be updated accordingly.
- Admin can also use command line tool to update website data to the elastic server.
- The Admin can set Multi-Match Query or Simple Match Query as the search type for the Frontend.
- If Multi-Match Query has been selected as the search type then the Customer can search data by name, SKU, description and short description of the Product.
- If Simple Match Query has been selected then the Customer can only find the Products by its name or SKU.
- It also has the Spell Correction Feature according to which the search engine automatically corrects the keywords even if they are typed incorrectly.
- “Did you Mean” feature allows the customers to search for the products if they mistakenly entered wrong product name so this feature will suggest them all the products which have nearby same product name.
- Admin can select character filters to replace or remove unwanted characters from search input.
- The Admin can also Select Language Stemmer store wise according to the store language.
Installation of the module is super easy, you just need to move the app folder into Magento root folder on the server as shown below in the snapshot.
After the successful installation, you have to run these commands in the Magento2 root directory.
First command- php bin/magento setup:upgrade
Second Command – php bin/magento setup:di:compile
Third Command – php bin/magento setup:static-content:deploy
After running these three commands you have to run this command:
composer require elasticsearch/elasticsearch:~6.0
After running the commands, you have to log into the admin panel and you have to clear the Cache. You can refer to the below screenshot.
Admin configuration of Magento 2 Elasticsearch
After the successful installation of this extension on your web store, the admin will navigate through Stores>Configuration->Catalog->Catalog->Catalog search->Search engine->Elastic.
After the search engine has been selected as Elastic then the Admin has to navigate through Stores->Configuration->Webkul->Elastic Search Setting->General Settings.
Here the Admin has to enter/Select:-
- Elastic server host in the Host field.
- Port Number:- In order to configure the elastic server.
- Index Prefix:- As we are using elastic search server on multiple websites and if we use index prefix, then during the reindexing of that particular website data will not affect the data on other websites.
- Check Connection Status:- To check the current status of the elastic server.
- Reset Connection:- If you click on this option, then the current connection will be reset and the entire data will be removed from the current elastic server. The Admin needs to reindex it again by navigating to the ElasticSearch>IndexManagement to do it manually or can set the reindexing automatically through a cron job.
In the Search Settings, The Admin can select Multi-Match Query or Simple Match Query as a search type for Frontend as shown below:
￼If the search type selected is Multi-Match Query then the Customer can search the product by the attributes which have been created by the Admin and the attribute type must be text.
￼Select Multi-Match Type
The Admin can select Multi-Match Type as Best Fields, Most Fields, Cross Fields and Phrase and Phrase Prefix. To learn more about Multi-Match Query, please go through the following link:
Select Operator For Multi Search- The Admin can select “AND” or “OR” operator for Multi-Search.
Minimum Should Match- The Admin can set minimum match percent to reduce low-quality matches in the search result.
2. Simple Match Query
If the search type selected is Simple Match Query then the Customer can search the product only by its name and SKU.
With the help of this feature, a Customer can search Categories, Pages or Products just by typing the Keywords.
Did You mean
This feature allows the customers to search for the products if they mistakenly entered wrong product name so this feature will suggest them all the products which have nearby same product name.
Shown in below screenshot.
￼Allow Spell Correction in Search
The Admin can also set the spell correction at Level 1 or Level 2, according to which the Elastic Search Engine automatically corrects the keywords even if they are typed incorrectly by the Customer.
Select Search Filters
The Admin can select the token filters to modify the search term provided by the Customer. There are basically 4 types of search filters:
- Synonym Filter
The Admin has to navigate through Marketing->Search Synonyms.
From here Admin can add a new synonym group. For example, the admin has added synonyms jeans, pants, pant.
Now if the Customer searches for any of these words the search engine will show all the results related to these words.
2. Elision Filter- A token filter which removes elisions. For example, “l’avion” (the plane) will be tokenized as “avion” (plane).
3. Lowercase Filter- A token filter of the type lowercase that normalizes token text to lower case.
4. Stop Word Filter- This filter is used to filter Stop Words from the search query. For example and, is, to are some of Stop Words.
To learn more about token filters please go through the following Link:
Select Language Stemmer
The Admin needs to select correct Language Stemmer according to the Magento 2 store language. For Example, if Store Language has been set as English, then the Customer can only search in the English Language.
Select Search Filters￼
These are the Character Filters which are used to remove unwanted characters from the search input. There are basically three types of character filters:
- HTML strip char filter- The HTML strip character filter removes HTML elements with the ones selected by admin.
- Mapping Filter- The mapping filter is used to replace mapping keys with values. So it will remove any character from the mapping.
- Pattern Replace Filter- This filter works in the same way as Mapping Filter. The only difference is that it is used for replacing pattern instead of mapping. It uses a regular expression to replace characters.
To learn more about the Character Filters, please go through the following link:
The Admin has to navigate through Elastic Search->Index management.
The Admin can also modify the Status of Index Type. The Admin can select either UPDATE ON SCHEDULE or UPDATE ON SAVE Mode for the Index Type. For example, if the Admin adds a new product, then he has to modify Status of a Product Index Type.
Set Cron for Index Management
The Admin can set Cron for Index Management on a daily, weekly or monthly basis, and can also set time so that if any changes are made, then those changes are updated in the Elastic Search Engine according to set frequency and time.
If the Admin has to modify the big volume of data, then the Admin can also use command line functions in the system shown below:
That’s all for the Magento 2 Elasticsearch module, still, have any issue feel free to add a ticket and let us know your views to make the module better webkul.uvdesk.com.
Current Product Version - 2.0.1
Supported Framework Version - 2.0.x, 2.1.x, 2.2.x