On projects with catalogs exceeding 10,000 SKUs, standard MySQL search in Magento 2 caused delays of 3–5 seconds per query, and relevance suffered—products were not found by partial matches or morphology. Starting with version 2.4.0, MySQL search was completely removed from the core, and Elasticsearch or OpenSearch became mandatory. We configure the search infrastructure so that users get accurate results in 100–200 ms, and conversion rates increase by 15–30%.
Why Elasticsearch/OpenSearch Are Mandatory for Magento
Modern versions of Magento (2.4.4+) do not support MySQL search. Without Elasticsearch or OpenSearch, you cannot perform full-text search, faceted filtering, or autocomplete. OpenSearch, a fork of Elasticsearch with the Apache 2.0 license, is preferable for new projects—it is more actively developed and has no usage restrictions. Sources: Elasticsearch Wikipedia, OpenSearch official site
| Magento Version | Elasticsearch | OpenSearch |
|---|---|---|
| 2.4.3 | 7.10 | — |
| 2.4.4–2.4.5 | 7.16–7.17 | 1.x |
| 2.4.6 | 8.x | 2.x |
| 2.4.7+ | 8.x | 2.x |
OpenSearch introduces new features faster (e.g., k-NN search) and has a more transparent development model.
How We Configure Search for the Russian Language
The standard Magento analyzer does not account for Russian morphology: the word 'платье' will not find 'платья'. We connect the analysis-icu plugin and configure a custom analyzer:
Click to view the analyzer configuration
PUT /magento2_product_1/_settings { "analysis": { "analyzer": { "russian_search": { "type": "custom", "tokenizer": "standard", "filter": ["lowercase", "russian_stop", "russian_stemmer"] } }, "filter": { "russian_stop": { "type": "stop", "stopwords": "_russian_" }, "russian_stemmer": { "type": "stemmer", "language": "russian" } } } } This approach improves relevance by 40–60% compared to the default analyzer. Without it, Russian-speaking users will not find products by inflections and cases, directly reducing conversion.
What Is Zero-Downtime Reindexing?
Magento uses an alias scheme: magento2_product_1 (active) and magento2_product_1_v2 (during reindexing). This allows updating the index without stopping search—saving on infrastructure through zero-downtime reindex. Attribute mapping is managed via Magento\Elasticsearch\Model\Adapter\FieldMapper. Custom attributes marked as searchable or filterable are automatically included in the index:
class CustomFieldMapper extends FieldMapper { public function getFieldName($attributeCode, $context = []) { if ($attributeCode === 'ean_code') { return 'keyword_ean_code'; // exact match } return parent::getFieldName($attributeCode, $context); } } The alias scheme ensures that during index rebuilding, the old index remains active. After completion, the index is switched atomically. This eliminates data loss and downtime.
Installing OpenSearch for Production
We recommend Docker or package installation on a separate server. For development, a single-node configuration is suitable:
# docker-compose.yml services: opensearch: image: opensearchproject/opensearch:2.11.0 environment: - discovery.type=single-node - DISABLE_SECURITY_PLUGIN=true - OPENSEARCH_JAVA_OPTS=-Xms2g -Xmx2g ports: - "9200:9200" ulimits: memlock: soft: -1 hard: -1 volumes: - opensearch-data:/usr/share/opensearch/data In a production cluster, a minimum of 3 nodes (1 master + 2 data). Example data-node configuration:
# /etc/opensearch/opensearch.yml cluster.name: magento-search node.name: data-node-1 node.roles: [data, ingest] network.host: 0.0.0.0 discovery.seed_hosts: ["master-node:9300"] cluster.initial_cluster_manager_nodes: ["master-node"] path.data: /var/lib/opensearch path.logs: /var/log/opensearch indices.memory.index_buffer_size: 20% thread_pool.write.queue_size: 1000 Additionally, configure heap size no higher than 50% of available memory and enable monitoring via _cluster/health.
Connecting Magento to OpenSearch
bin/magento config:set catalog/search/engine opensearch bin/magento config:set catalog/search/opensearch_server_hostname 127.0.0.1 bin/magento config:set catalog/search/opensearch_server_port 9200 bin/magento config:set catalog/search/opensearch_index_prefix magento2 bin/magento config:set catalog/search/opensearch_enable_auth 0 bin/magento config:set catalog/search/opensearch_server_timeout 15 bin/magento indexer:reindex catalogsearch_fulltext bin/magento cache:flush curl -X GET "localhost:9200/_cat/indices/magento2*?v&pretty" curl -X GET "localhost:9200/magento2_product_1/_mapping?pretty" | head -80 How to Configure Relevance Step by Step
- Set attribute weights (name, description) in the Magento admin (values 1–10).
- Programmatically override
Magento\Elasticsearch\SearchAdapter\Query\Builder\Matchfor custom rules. - Enable
fuzzinessfor high-weight fields—this corrects typos. - Add a custom Russian language analyzer (as shown above).
- Check results via slow logs and tune thresholds.
Improved search conversion directly increases store profitability. We recommend starting with an audit of your current configuration—this takes no more than an hour.
What's Included in Search Setup Work
- Audit of current configuration and performance
- Installation and configuration of an OpenSearch (or Elasticsearch) cluster
- Integration with Magento 2, including custom analyzers and weights
- Optimization for Russian language (morphology, stemming)
- Configuration of alias indices for zero-downtime reindex
- Monitoring setup (slow logs, cluster health)
- Documentation and team training
- Post-release support (1 month)
We complete a turnkey setup in 3–5 days, depending on catalog complexity. Typical projects cost from $1,500 to $4,000. With our 5+ years of experience and over 50 successful Magento search projects, we guarantee improved search relevance and a measurable increase in conversion rates. Contact us for a free consultation—we will assess your project and propose the optimal solution. Get a consultation on Magento 2 search configuration—we will evaluate your needs and deliver a customized setup.
Timelines for Setup
| Stage | Duration |
|---|---|
| OpenSearch installation + connection | 1 day |
| 3-node cluster with replication | 1–2 days |
| Customization of analyzers and weights | 2–3 days |
| Integration with Smile ElasticSuite | 3–5 days |
Monitoring and Troubleshooting
Key metrics: Heap usage (not above 75% of -Xmx), Search latency (p95 < 200 ms), Indexing rate. For diagnostics we use slow logs. A common issue: mapper [price_0_1] cannot be changed from type [float] to [double]. Solution—delete and recreate the index using curl -X DELETE "localhost:9200/magento2_product_*" && bin/magento indexer:reindex catalogsearch_fulltext. Get a consultation if you need help with non-standard cases. Contact us to discuss details.







