Skip to content

Using Elasticsearch with Magento

Elasticsearch is a powerful search engine that improves product search speed and accuracy in Magento. It replaces the default MySQL search with a scalable, full‑text search solution. On ruachost.com, Elasticsearch is supported for Magento 2.4 and later.

  • Provides fast, relevant search results for customers.
  • Supports advanced features like autocomplete, synonyms, and spell correction.
  • Scales easily for large catalogs with thousands of products.
  • Improves overall site performance compared to MySQL search.

Steps to Configure Magento with Elasticsearch

Section titled “Steps to Configure Magento with Elasticsearch”
  • On Managed VPS/Dedicated Servers → Ruachost support can install Elasticsearch for you.

  • On Unmanaged VPS → Install manually via SSH:

    Terminal window
    apt-get install elasticsearch

    or

    Terminal window
    yum install elasticsearch

Step 2: Configure Magento to Use Elasticsearch

Section titled “Step 2: Configure Magento to Use Elasticsearch”
  1. Log in to Magento Admin.

  2. Go to Stores → Configuration → Catalog → Catalog Search.

  3. Under Search Engine, select Elasticsearch.

  4. Configure the following settings:

    • Elasticsearch Server Hostname → 127.0.0.1 (or your server’s IP).
    • Elasticsearch Server Port → 9200.
    • Index Prefix → Optional, useful for multiple Magento installations.
    • Enable Elasticsearch HTTP Auth → Yes/No depending on your setup.
    • Elasticsearch Server Timeout → Recommended: 15.
  5. Save configuration.

  • Run reindexing via CLI:

    Terminal window
    php bin/magento indexer:reindex
  • Clear cache:

    Terminal window
    php bin/magento cache:flush
  • Test product search in your storefront.

  • Elasticsearch is required for Magento 2.4 and newer.
  • Ensure your server meets memory requirements (at least 2GB RAM for Elasticsearch).
  • If using multiple stores, configure separate index prefixes.
  • Always back up your site before making configuration changes.