SEO & Performance

Elasticsearch for Magento: Faster Catalog Search at Any Scale

11 min read·260 words
Elasticsearch for Magento: Faster Catalog Search at Any Scale

Magento's native search struggles with large catalogs. We walk through setting up Elasticsearch 8, custom analyzers, synonyms, and boosting rules that make search feel instant.

MySQL-based catalog search breaks at around 10,000 SKUs — slow results, no relevance ranking, and zero tolerance for typos. Elasticsearch (or OpenSearch) solves all three. Magento has built-in Elasticsearch support, but the default configuration leaves most of its power untapped. Here's how to configure it for real-world catalog search performance.

Core Configuration

Point Magento to your Elasticsearch cluster in Stores > Configuration > Catalog > Catalog Search. Set index prefix to differentiate multiple Magento installations on the same cluster. After configuration, run bin/magento indexer:reindex catalogsearch_fulltext to build the initial index. Monitor index size — a catalog of 50,000 products typically produces a 500MB-2GB index.

Synonyms and Stopwords

Product search fails users when they search for 'jeans' but your catalog uses 'denim trousers'. Configure synonym mappings in Elasticsearch to expand queries with equivalent terms. Synonyms are defined in an index settings file and applied at query time. Also configure domain-specific stopwords — for a fashion retailer, 'buy', 'cheap', and 'new' add noise without helping relevance.

Relevance Tuning

Magento's default Elasticsearch configuration gives equal weight to all product attributes. Tune field boosts to match your business: boost product name (10x), brand (5x), and short_description (2x). Demote long_description. Add popularity-based boosting using order count or view count to surface best-selling products in mixed-relevance results.

Faceted Navigation Performance

Elasticsearch's aggregation engine powers Magento's layered navigation. For catalogs with many attributes and high cardinality, aggregation queries can be slow. Optimize by limiting the number of facets shown simultaneously, using term aggregations instead of range aggregations where possible, and caching aggregation results for popular filter combinations.

# magento# ecommerce# adobe-commerce# seo-&-performance# core-web-vitals# pagespeed# seo# lcp