Reading list Switch to dark mode

    Magento 2 Elasticsearch Module

    Updated 22 April 2024

    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.

    Also, if you want to enhance your store with the AI-powered image search for products, you can check Magento 2 AI Image Search.

    Watch the video tutorial below to understand Magento 2 Elastic Search extension workflow:

    Searching for an experienced
    Magento 2 Company ?
    Find out More

    Features of Magento 2 Elasticsearch Extension

    • 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 Elastic Search extension.

    Installation of Magento 2 Elastic Search Extension

    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.


    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:deploy5

    After running the commands, the admin has to log into the admin panel and clear the cache, according to the below screenshot.


    Language Translation

    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.

    Magento 2 PMarketplace ChatGPT Content Generator Installation 2

    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.

    language translation i18 folder csv file

    Admin configuration of Magento 2 Elasticsearch

    After the successful installation of Magento 2 Elastic Search 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:-

    1. Add the elastic server hostname in the Host field.
    2. Port Number:- To configure the elastic server enter the port number.
    3. 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.
    4. Check Connection Status:- Check the current status of the elastic server. 
    5. 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 Extension

    Here, The Admin can select any query as a search type for the frontend, such as Multi-Match Query or Simple Match Query:

    admin1. 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.

    search settings

    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.

    Magento 2 Elasticsearch - simple-match-qwery

    Search Suggestion in Magento 2 Elastic Search Extension

    In search suggestions, with the help of keywords, customers can search categories, pages, or products.

    Magento 2 Elasticsearch - search sugg

    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.

    Magento 2 Elasticsearch - did-you-meanSpell 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.

    Magento 2 Elasticsearch - product

    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.

    1. Synonym Filter

    The admin has to navigate through Marketing > Search Synonyms.

    Magento 2 Elasticsearch - synonyms

    Admin can create a new synonym group from here. For example, the admin has added synonyms for jeans and pants.

    Magento 2 Elasticsearch - synonym group

    Now, the search engine will display all the results connected to any of these keywords if the customer searches for one of them.

    Magento 2 Elasticsearch - products

    2. Elision Filter- An elisions-removing token filter. For example, “L’avion” (the plane) will be parsed as “avion” (plane).

    3. Lowercase FilterA lowercase token filter that converts token text to lowercase.

    4. Stop Word FilterStop 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.

    Magento 2 Elasticsearch - search-setting

    1. HTML strip char filter– The HTML strip character filter strips off the HTML parts.
    2. 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.
    3. 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.

    Magento 2 Elasticsearch - elastic indexes

    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.

    Magento 2 Elasticsearch - elastic index

    So, the admin can also use the system command line features if they have to change a large amount of data.

    Magento 2 Elasticsearch

    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

    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

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*

    Be the first to comment.

    Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home

    Table of Content