{"id":1542,"date":"2021-02-02T10:39:53","date_gmt":"2021-02-02T10:39:53","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/configure-magento-2-elasticsearch\/"},"modified":"2025-07-22T17:14:16","modified_gmt":"2025-07-22T11:44:16","slug":"configure-magento-2-elasticsearch","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/configure-magento-2-elasticsearch\/","title":{"rendered":"How to Configure Magento 2 Elasticsearch"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Search functionality is undoubtedly one of the most crucial features of any online store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A powerful search helps the visitors find their desired products on the Magento 2 store quickly. It contributes to the improved in-store experience and quick purchase decisions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whereas, if customers don\u2019t get instant search results, they tend to bounce back and move on to your competitors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore, it\u2019s essential to enhance the search feature, and&nbsp;<a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-operations\/installation-guide\/overview\" target=\"_blank\" rel=\"noreferrer noopener\">Elasticsearch<\/a>&nbsp;is one of the best ways to improve the search feature in Magento 2 stores.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The store admin can&nbsp;<em><strong>configure Magento 2 Elasticsearch&nbsp;<\/strong><\/em>to use its features like an open-source, readily-scalable, analytics, broadly-distributable, enterprise-grade search engine including textual, numerical, geospatial, structured, and unstructured.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the stepwise method to configure Easticsearch in Magento 2.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Steps to Configure Magento 2 Elasticsearch:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">1. <strong>Login<\/strong>&nbsp;to the admin panel<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Go to&nbsp;<strong>Stores<\/strong>&nbsp;&gt;&nbsp;<strong>Configuration<\/strong>&nbsp;of your Magento 2 store.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Click on the&nbsp;<strong>Catalog<\/strong>&nbsp;option of the&nbsp;<strong>Catalog<\/strong>&nbsp;tab<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Expand the&nbsp;<strong>Catalog Search<\/strong>&nbsp;and select the version of Elasticsearch in the&nbsp;<strong>Search Engine&nbsp;<\/strong>option<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5. Click on the&nbsp;<strong>Save Config<\/strong>&nbsp;button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2021\/02\/config.jpg\" alt=\"How to Configure Magento 2 Elasticsearch\" class=\"wp-image-13077\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&nbsp;Configure the Elasticsearch Connection<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To configure Elasticsearch, follow the below steps.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. <strong>Elasticsearch Server Hostname:&nbsp;<\/strong>Enter the server Elasticsearch server hostname. The default is localhost.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. <strong>Elasticsearch Server Port:&nbsp;<\/strong>Enter the Server port of Elasticsearch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. <strong>Elasticsearch Index Prefix:&nbsp;<\/strong>Enter a prefix&nbsp;to determine the Elasticsearch index. For instance: Magento2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. <strong>Enable Elasticsearch HTTP Auth: S<\/strong>elect \u201cYes\u201d to use HTTP authentication to suggest a username and password access Elasticsearch Server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5. <strong>Elasticsearch Server Timeout:&nbsp;<\/strong>Enter the number of seconds before the system times out here. The default number is 15.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Test Connection:&nbsp;<\/strong>To verify the configuration, click on the&nbsp;Test Connection&nbsp;button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/meetanshi.com\/blog\/wp-content\/uploads\/2021\/01\/config2-2.jpg\" alt=\"Configuration\" class=\"wp-image-12835\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also refer to the&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/install-elasticsearch-on-google-cloud\/\" target=\"_blank\" rel=\"noreferrer noopener\">method to install Elasticsearch on Googlecloud<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One thing that is noteworthy to mention here is that Elastic search is not compatible with varchar fields. Therefore, it is essential to disable the varchar fields for the elastic search. Many of the store owners reported an&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/magento-2-4-elastic-search-error-text-fields-are-not-optimised-for-operations\/\" target=\"_blank\" rel=\"noreferrer noopener\">Elastic Search Error: \u2018Text Fields are Not Optimised for Operations\u2019<\/a>&nbsp;in Magento 2.4.x, which was caused by the varchar fields ser filterable in elastic search.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don\u2019t forget to share the solution with Magento Community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank You.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Search functionality is undoubtedly one of the most crucial features of any online store. A powerful search helps the visitors find their desired products on&#8230;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1542","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1542"}],"version-history":[{"count":3,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1542\/revisions"}],"predecessor-version":[{"id":13875,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1542\/revisions\/13875"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}