Skip to content

Configure Magento 2 for Elasticsearch

After enabling Elasticsearch, you need to enable it in your store to begin serving search results.

  1. Log into your Magento 2 admin or backend
  2. Open Stores->Configuration from the sidebar Elasticsearch configuration-75
  3. Expand the Catalog section, then click Catalog.
  4. Click **Catalog Search Catalog Search-15

  5. Next to the Search Engine field, uncheck the “use system value” box if checked.

  6. Set the search engine to Elasticsearch 5.0+
  7. Set the Elasticsearch Server Hostname to elasticsearch
  8. Leave all other settings default
  9. Test the connection, it should be successful
  10. Click Save Config near the top right of your screen to confirm the change. ES Config-55

  11. Either via your Magento backend or SSH/CLI shell, reindex your catalogsearch_fulltext index.  Search data will populate indexes within Elasticsearch. You must do this or the frontend of your store will break. Category pages in Magento 2 rely on the catalog search. if no search is available your categories cannot be displayed.