Since Magento 2.4, a real search engine is not optional - MySQL search was removed and every store runs on Elasticsearch or its fork OpenSearch. The good news is that a single-node setup is simple. The bad news is that a neglected search node is one of the most common causes of store outages we get called about. Here is how to set it up properly.
Elasticsearch or OpenSearch?
Adobe Commerce Cloud standardised on OpenSearch; on-premise, both are supported. Check your exact Magento version’s system requirements before installing - Magento validates the engine version at setup and refuses mismatches. For new self-hosted builds we default to OpenSearch for licensing simplicity.
Installation and Magento Connection
Install the engine, then wire it into Magento:
bin/magento config:set catalog/search/engine opensearch
bin/magento config:set catalog/search/opensearch_server_hostname localhost
bin/magento config:set catalog/search/opensearch_server_port 9200
bin/magento config:set catalog/search/index_prefix magento2
bin/magento indexer:reindex catalogsearch_fulltext
Always set an index_prefix. It namespaces your indices so a staging and production store can share a cluster without colliding, and it makes reindex surgery far easier.
Memory and Sizing
The engine lives and dies by heap and disk:
- Set the JVM heap to half the node RAM, capped at about 16GB:
-Xms4g -Xmx4ginjvm.options - Keep disk watermark defaults in mind - at 85 percent disk usage the engine stops allocating shards and your storefront search breaks in confusing ways
- For most catalogs under 100k SKUs, a single node with 4GB heap is comfortable
Tuning Search Quality
Default relevance is rarely good enough for retail. The levers worth pulling:
- Synonyms: map “hoodie” to “hooded sweatshirt” in Marketing > Search Synonyms so customers find what they mean, not what they typed
- Stop words and attribute weights: mark product name as high weight, description as low, and exclude attributes that pollute results
- Search terms report: the Marketing > Search Terms report is a goldmine - review it monthly and feed the failures back into synonyms
Operations Essentials
- Reindex after bulk catalog changes:
bin/magento indexer:reindex catalogsearch_fulltext - Monitor cluster health:
curl localhost:9200/_cluster/health?pretty- yellow is a warning on a single node, red is an incident - Snapshot before upgrades. An index can always be rebuilt, but a snapshot turns a bad upgrade into a five-minute rollback
A well-tuned search engine is invisible to customers; a badly tuned one costs you sales on every visit. Spend the hour on synonyms and attribute weights - it is the cheapest conversion work available on a Magento store.