Search
×
Log in or create an account
If you have an account with us, please log in.

You have no items in your shopping cart.

Frequently Asked Questions

How can we help you?

banner image

What is Elasticsearch and how to configure a query in Magento 2?

Elasticsearch is mandatory in the latest Magento 2 version, so you need to know what Elasticsearch is and how it works. Elasticsearch is one of the most popular systems in the Big Data industry. It is an open-source scalable non-relational data warehouse, an analytical NoSQL DBMS with a wide range of full-text search functions. In simple words, it allows you to store, search, and analyze huge volumes of data. Unlike MySQL, Elasticsearch is highly customizable, extendable through plugins. You can build a robust search without much knowledge quite fast. While Elasticsearch is a must in the Magento 2.4 version, you can still make it more user-friendly with the Elastic Search extension. 

To configure the query in the Elastic Search extension, do the following:

Step 1. Make a general configuration of the module by setting up the connection and setting Autocomplete suggestions & Spelling correction.

Step 2. Then navigate to Admin Panel > Stores > Product and choose a needed attribute.  Next, go to the Storefront Properties option and switch the Use in Search option to Yes to add a product attribute to a search query configuration. 

Step 3. Now, go to the Catalog settings section on the Configuration tab and specify the Search Query Settings for each product attribute:

elastic-query-settings

Step 4. Specify the way to combine keywords in a search query for each product attribute:

  • OR to return results that contain either the first and second(more) word of the query.
  • AND to return only results that contain all the words of the query.

Step 5. After that, complete Indexation Settings:

elastic-indexation

  • In the Char Mapping setting, you need to specify characters and values to convert them into.
  • Switch the Use Inbox Stopwords option to Yes if you want to apply a default set of stopwords and choose the language in the shown dropdown.
  • Switch the Use Inbox Stemming option to Yes if you want to use stemmed words in a search. This feature allows your customers to search items by the root form of the word.

Step 6. Save the changes.

Now you can go to the storefront and test if the search works correctly. Check the user guide for more details about extension settings.

The Elastic Search extension provides a wide range of features but to provide the user with a good search experience on any device, use the PWA add-on for Elastic Search to guarantee your customers a hassle-free product search from any device.

Rate the answer?

Total rating: 4.6

If you didn’t find the answer on your question, please, ask here:

Back to top