Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

What is Magento 2 Elasticsearch? How to configure it?

Magento 2 is a powerful e-commerce platform. It allows merchants to create and manage their online stores easily. Magento 2 update had a great performance improvement and added tons of new features. One feature that makes Magento 2 so powerful is the integration of Elasticsearch. Elasticsearch is a popular open-source search engine.

This blog will explore Elasticsearch and how it works with Magento 2. We’ll also see how you can configure it to improve the search experience for your customers.

It doesn’t matter if you’re a seasoned Magento developer or starting e-commerce. This guide will help you configure Magento 2 Elasticsearch to get the most out of your online store.

So let’s learn more about Magento 2 Elasticsearch!

What is Elasticsearch?

It is an open-source search engine based on the Apache Lucene library. It provides a distributed, multitenant-capable full-text search engine. It also provides an HTTP web interface and schema-free JSON documents.

It is based on the Apache Lucene search library. It supports many features, including full-text search, real-time analytics, and data visualization.

Elasticsearch can be used to search for data across many indices and types. It is often used for full-text search, log, security, and business analytics.

You would’ve gotten some idea about elastic search. Now, let us know what Magento 2 Elasticsearch means.

Magento 2 Elasticsearch is an open-source, highly scalable search engine powering eCommerce stores. It provides advanced full-text search capabilities. The Apache Lucene library powers it.

It also provides improved relevance and performance compared to the default search engine in Magento 2. It can be used for autocomplete, advanced search queries, and analytics.

Benefits of Magento 2 Elasticsearch

Here are some of the benefits of Magento 2 Elasticsearch:

1. Faster Search & Improved Relevancy: Magento 2 Elasticsearch provides faster search results. It also provides more relevant results for customers.

2. Easy Installation & Configuration: Magento 2 Elasticsearch is easy to install and configure.

3. Highly Scalable: Magento 2 Elasticsearch is highly scalable. It can also handle large amounts of data.

4. Secure: Magento 2 Elasticsearch is secure and provides tight access control.

5. Automated Indexing: Magento 2 Elasticsearch automatically indexes data as it is added or modified.

6. Rich Querying Capabilities: Magento 2 Elasticsearch provides rich querying capabilities to retrieve more accurate and relevant search results.

7. Analytical & Reporting Tools: Magento 2 Elasticsearch provides analytical and reporting tools to gain insights into customer behavior.

8. Enhanced User Experience: Search results are displayed in a more user-friendly format, with facets and filters. This enables the customers to narrow their search quickly and easily.

9. Auto-Suggest Feature: Elasticsearch offers an auto-suggest feature for customers, making it easier to find the products they are looking for.

Magento 2 Elasticsearch Configuration Prerequisites

Before you can start using Elasticsearch with Magento 2, there are a few prerequisites that you need to meet.

  • Elasticsearch Server: To use Elasticsearch with Magento 2, you need to have an Elasticsearch server set up and run. This can be done on a local machine or remote server. You will also need to know the server’s address and port number so Magento can connect.
  • PHP Extension: Magento 2 uses the PHP extension “elasticsearch” to connect to the Elasticsearch server. This extension needs to be installed and enabled on your server.
  • Elasticsearch Version: Magento 2 only supports specific versions of Elasticsearch, so it is essential to check that your Elasticsearch server is running a compatible version. The recommended version for Magento 2.4.x is 7.6.x, and for Magento 2.3.x, it is 6.8.x.

After checking these prerequisites, you can now configure Magento 2 Elasticsearch to use Elasticsearch and take advantage of its powerful search capabilities. Now, let’s see how we can configure Magento 2 Elasticsearch.

How to Easily Configure Magento 2 Elasticsearch in 3 Steps

Step 1: Catalog Search Configuration

  • Log in to your Magento admin panel. Go to Stores > Settings > Configuration
  • Now select Catalog under CATALOG from the left side panel
  • Next, expand the Catalog Search section
  • Here, clear the Use System Value for the Search Engine field and select the latest version of Elasticsearch.

In this section, you can also specify the following settings:

  • Minimum Query Length: Users must write at least this many characters before seeing Magento 2 Elasticsearch recommendations or suggestions. In this instance, the system default value is 3.
  • Maximum Query Length: Users can only type up to many characters to view results. In this instance, the system default value is 128.
  • Number of top search results to cache: For quicker answers, you can limit the number of popular search results by setting the corresponding value in this field. 100 is the default value. When a value of 0 is entered, all search words and results are cached for later entry.
  • Enable or disable EAV Indexer: EAV Indexer can be turned on or off to increase indexation speed and prevent third-party extensions from using it.
  • Autocomplete Limit: Set an amount for Autocomplete Limit to restrict the maximum search results displayed for Magento 2 Elasticsearch autocomplete. Limiting this quantity improves search efficiency and lessens the size of the displayed list. The standard setting is 8.

Step 2: Elasticsearch Search Connection Configuration

You will need to configure Magento to connect to it by going to the Magento admin panel and navigating to Stores > Configuration > Catalog > Catalog > Catalog Search. You can specify the Elasticsearch server’s hostname, port, and other settings here.

Elasticsearch Server Hostname: In this field, type the hostname for the Elasticsearch server. Localhost is used by default.

Elasticsearch Server Port: Enter the Elasticsearch Server Port in this field.

Elasticsearch Index Prefix: To find the Elasticsearch index, define a prefix in the Elasticsearch Index Prefix field.

Enable Elasticsearch HTTP Auth: Choose Yes to enable HTTP authentication in the Enable Elasticsearch HTTP Auth field and enter a username and password to access the Elasticsearch server.

Elasticsearch Server Timeout: In this field, enter the number of seconds before which the system times out. The default value is 15.

After configuring all the fields, click the Test Connection button to confirm the configuration.

Step 3: Elasticsearch Recommendations Configuration

Magento 2 Elasticsearch can be configured to provide customer recommendations and suggestions based on their search queries and browsing history. This can improve the customer experience by providing relevant and personalized recommendations and suggestions.

To configure Magento 2 Elasticsearch recommendations and suggestions, you will first need to ensure that your Elasticsearch server is configured correctly and connected to Magento. Once the connection is established, you can enable recommendations and suggestions by going to the Magento admin panel and navigating to Stores > Configuration > Catalog > Catalog > Catalog Search.

Here, you can set the value of the field Enable Search Recommendations to Yes and configure the settings for recommendations.

Once you enable this option, two additional fields will appear: Search Recommendations Count and Show Results Count for Each Recommendation.

Search Recommendations Count: Define the number of search recommendations in the Search Recommendations Count.

Show Results Count for Each Recommendation: The result would be shown with each recommendation if the option to Show Results Count for Each Recommendation is set to Yes.

Now, you can configure the settings for suggestions by setting the value of the field Enable Search Suggestions to Yes.

Search Suggestions Count: Define the count for search suggestions in Search Suggestions Count. Each search returns an average of two suggestions.

Show Results Count for Each Suggestion: The count for each suggestion would be shown if the option to Show Results Count for Each Suggestion is set to Yes.

Minimum Terms to Match: Set a value for Minimal Terms to Match to indicate the minimum number of terms from your query that the search results must match to be returned. This guarantees that shoppers get the most relevant results.

It’s important to note that the recommendations and suggestions will only be displayed if the Elasticsearch server can return results for the customer’s search query. So, make sure that your Elasticsearch server is configured correctly and indexed before enabling recommendations and suggestions.

Configuring Magento 2 Elasticsearch recommendations and suggestions can help improve the customer experience by providing relevant and personalized recommendations and suggestions based on their search queries and browsing history. With the proper configurations, it can increase the chances of customer conversion.

Conclusion

In conclusion, Elasticsearch is a powerful tool that can significantly enhance the search capabilities of your Magento 2 e-commerce store. By providing fast and accurate search results, Elasticsearch can improve the customer experience and drive more sales for your business.

This blog has explored Elasticsearch and how it works with Magento 2. We’ve also provided a step-by-step guide on how to configure it. Following this blog’s tips and best practices, you can optimize your Elasticsearch integration and take your online store to the next level.

However, we recommend getting Magento development services if you still need help following the process or wish to install and configure Magento 2 Elasticsearch seamlessly.

We hope you have found this information helpful, and we encourage you to continue learning more about Magento 2 and how to make the most of its features.



This post first appeared on Magento 2 Ecommerce, please read the originial post: here

Share the post

What is Magento 2 Elasticsearch? How to configure it?

×

Subscribe to Magento 2 Ecommerce

Get updates delivered right to your inbox!

Thank you for your subscription

×