You can include the Elasticsearch engine in your Magento 2 (Adobe Commerce) web store with the help of the Magento 2 Elasticsearch extension. The elastic search engine is a highly scalable and open-source full-text search engine.
It enables quick storage, searching, and analysis of large volumes of data. Also, it is a fast search engine that instantly displays the results of the given query.
Note: Elastic Search Engine v7.6 must be set up and functioning on the system before installing the Magento 2 Elastic search module.
Watch the video tutorial below to understand the extension workflow:
Features of Magento 2 Elasticsearch
- The elastic search engine can quickly replace the function of the MySQL search engine.
- The elastic server’s admin can easily update the data for products, categories, and CMS pages on the server.
- The index type determines how the data is saved on the elastic server.
- The admin will use a command line program to update website data on the elastic server.
- The Frontend’s search type can be adjusted by the Admin to either Multi-Match Query or Simple Match Query.
- Customers can search data by name, SKU, description, and a product short description if Multi-Match Query has been chosen as the search type.
- Customers can only find the products by name or SKU if a simple Match Query is chosen.
- The spell-checking feature in the Magento 2 Elasticsearch plugin allows the search engine to rectify keywords even when they are entered improperly.
- Customers can search for products if they accidentally type the incorrect product name using the Did you Mean button. As a result, this feature will recommend to them all the products with the same product name that is nearby.
- The admin can choose character filters to replace or delete unwanted characters from the search input.
- The admin can also choose the language stemmer for each store under the language in the Magento 2 Elasticsearch store.
Installation of Magento 2 Elastic Search
Installation of the Magento 2 elastic search plugin is easy. Admin needs to select the app folder into the Magento root folder on the server shown in the snapshot.
Magento 2 Company ? Find out More
Once the plugin is installed, the admin has to run the following 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 the commands, the admin has to log into the admin panel and clear the cache, according to the below screenshot.
For translating the module language, navigate through src/app/code/Webkul/ElasticSearch/i18n and edit the en_US.csv file. Thereafter, rename the CSV as “en_SA.csv” and translate all right side content after the comma in the Arabic language. After editing the CSV, save it.
Now, upload it to the path src/app/code/Webkul/ElasticSearch/i18n where the installation of Magento 2 is on the server. The module translates into the Arabic Language. It supports both RTL and LTR languages.
The user can edit the CSV like the image below.
Admin configuration of Magento 2 Elasticsearch
After the successful installation of this extension on your Magento 2 store, the admin will navigate through Stores > Configuration > Catalog > Catalog search > Search engine and then select Webkul Elasticsearch.
Magento 2 Elasticsearch General Settings
Once the search engine got selected as Webkul Elasticsearch, the admin will navigate through Stores > Configuration > Webkul > Elastic Search Setting > General Settings.
Here the Admin has to enter/Select:-
- Add the elastic server hostname in the Host field.
- Port Number:- To configure the elastic server enter the port number.
- Index Prefix:- We are using an elastic search server on multiple websites. If we use an index prefix on websites, then at the time of re-indexing, that particular website data will not affect other websites.
- Check Connection Status:- Check the current status of the elastic server.
- Reset Connection:- The connection will be reset if you choose this option, and all data will be deleted from the current elastic server. The administrator must manually reindex it by going to Elastic search > Index management.
Search Settings of Magento 2 Elasticsearch
Here, The Admin can select any query as a search type for the frontend, such as Multi-Match Query or Simple Match Query:
1. Multi-Match Query
If the Multi-Match query search type enables, the customer can search for a product using its attributes. The attribute type must be text and created by the admin.
Select Multi-Match Type
Furthermore, the admin need to select multi-match type as the best field, most Fields, cross fields, phrase, and phrase prefixes.
To learn more about Multi-Match query, please go through the following link:
Select Operator For Multi-Search– The admin can select the “AND” or “OR” operator for multi-search.
Minimum Should Match– The admin can set a minimum match percentage to reduce low-quality matches in the search result.
2. Simple Match Query
If Simple Match Query is selected in the search type, the customer can only search for a product by its name and SKU.
Search Suggestion in Magento 2 Elasticsearch
In search suggestions, with the help of keywords, customers can search categories, pages, or products.
Magento 2 Elasticsearch Did You mean
When a customer enters the wrong product name, it will recommend all nearby products with the same product name to the customers.
Shown in the below screenshot.
Spell Correction in Search
The Elastic Search Engine will automatically correct keywords when they wrote incorrectly by the customer if the spell check is set to Level 1 or Level 2 by the admin.
Select Search Filters
There are four types of search filters to modify the search term provided by the customer. The admin can select the token filters.
- Synonym Filter
The admin has to navigate through Marketing > Search Synonyms.
Admin can create a new synonym group from here. For example, the admin has added synonyms for jeans and pants.
Now, the search engine will display all the results connected to any of these keywords if the customer searches for one of them.
2. Elision Filter- An elisions-removing token filter. For example, “L’avion” (the plane) will be parsed as “avion” (plane).
3. Lowercase Filter– A lowercase token filter that converts token text to lowercase.
4. Stop Word Filter– Stop words are removed from the search query. Examples of stop words are and, is, and to.
To learn more about token filters, please go through the following Link:
Select Language Stemmer
According to the language of the Magento 2(Adobe Commerce Cloud) store, the admin must choose the appropriate Language Stemmer.
For example, if the store language is set as English, the customer can only search in English.
Select Character Search Filters in Magento 2 Elasticsearch
There are three types of character filters. That is used to remove unwanted characters from the search input.
- HTML strip char filter– The HTML strip character filter strips off the HTML parts.
- Mapping Filter– The mapping filter is used to swap out the mapping keys with values. So, it will eliminate any character from the mapping in the Magento 2 Elasticsearch module.
- Pattern Replace Filter– The Pattern Replace Filter functions similarly to the Mapping Filter. The main difference is that it’s used to replace patterns instead of mapping them. To replace characters, it makes use of a regular expression
To learn more about the character filters, please go through the following URL:
Index Management of Magento 2 Elasticsearch
Moreover, the admin can navigate through elastic search > index management.
The admin can change the status of the index type. For the index type, the admin has two options: update on save mode or update on a schedule. For example, the admin must change the status of a product index type whenever he adds a new product.
So, the admin can also use the system command line features if they have to change a large amount of data.
That is all for the Magento 2 Elasticsearch module. Still, have any issues feel free to add a ticket and let us know your views to make it better at webkul.uvdesk.com.
Current Product Version - 5.0.1
Supported Framework Version - Magento 2.0.x, 2.1.x, 2.2.x,2.3.x, 2.4.x