How To Set Up Magento OpenSearch?

How To Set Up Magento OpenSearch?

Are you frustrated with the limited search functionality of your Magento store? Magento Open Search is your solution. It facilitates improved search experiences by leveraging the capabilities of Elasticsearch. It offers swift, accurate results, enhancing user satisfaction and engagement.


This tutorial will cover how to set up Magento Open Search services. We'll guide you through integrating this powerful search tool with your Magento store.

Best Magento Hosting now

Key Takeaways

  • Discover how Magento Open Search boosts your store's search functionality.

  • Learn the step-by-step process to set up Open Search with Magento.

  • Understand OpenSearch's compatibility with Adobe Commerce.

  • Explore the benefits of switching from Elasticsearch. It offers better security and performance by adopting OpenSearch.

What is OpenSearch in Magento 2?

Understanding Magento OpenSearch

Magento Opensearch is a free, open-source search tool based on Elasticsearch.

OpenSearch serves diverse purposes, ranging from search engines to data analysis. It emerged as a fork of Elasticsearch 7.10.2 and Kibana 7.10.2 in response to significant licensing changes by Elasticsearch. These changes prompted concerns within the open-source community regarding the future accessibility and openness of Elasticsearch and Kibana. OpenSearch represents a community-driven alternative, ensuring continued access to:

  • Open-source tool

  • Free search

  • Analytics suite

Its core functionalities enable seamless storage, search, and analysis of large datasets in near real-time, catering to applications requiring intricate text-heavy or complex data structure searches.


The popularity of OpenSearch stems from its effectiveness in addressing various needs. It has become the preferred choice for a wide array of implementations. It includes website and logging system searches. Its versatility and capabilities make it a valuable tool for organizations seeking robust search solutions.

How to Migrate to OpenSearch from ElasticSearch?

To migrate from Elasticsearch to OpenSearch for Adobe Commerce on Cloud or Magento Open Source, including version 2.4.6, follow these steps, integrating key terms.

Step 1: Backup Elasticsearch

  • Use GitHub for scripting data snapshots.

  • Include the catalog search index in snapshots.

Step 2: Prepare OpenSearch

  • Set up an OpenSearch cluster.

  • Consider compatibility with Elasticsearch 7 or 7.10.2.

  • Ensure settings like cluster_name, build_hash, and lucene_version match requirements

Step 3: Data Migration

  • Use snapshots and restore or reindex for data migration.

  • Adjust for minimum_wire_compatibility_version and minimum_index_compatibility_version.

Step 4: Configuration Update

You can switch from Elasticsearch to OpenSearch for configuration updates in Adobe Commerce. It ensures that hostname and build_snapshot are set for OpenSearch.

Step 5: Testing

  1. Verify the migration by checking the following
  • Catalog search index

  • Compatibility

  • Performance

  1. Environments for verification
  • Docker

  • AWS

  • On-premises

Step 6: Monitoring and Support

After migration, use OpenSearch Dashboards for monitoring. If errors occur, seek support from Adobe Commerce or Magento Open Source teams.

  • Update all installations, including cloud, on-premises, or Adobe Commerce Cloud.

  • They should continue supporting Elasticsearch until transitioning to OpenSearch.

  • Elasticsearch versions newer than 7.10 won't work with Adobe Commerce on Cloud Infrastructure version 2.4.4.

  • Upgrade to Adobe Commerce 2.4.4 and transition to OpenSearch version 1.2.x.

  • ElasticSearch 7 and OpenSearch 1.2 are compatible with each other.

  • OpenSearch is the default option for new Adobe Commerce Cloud installs.

  • OpenSearch and OpenSearch Dashboards enhance eCommerce platform search capabilities.

Configure OpenSearch Service in Adobe Commerce on Cloud

Step 1: Add OpenSearch Service to Your Project:

  1. Navigate to your .magento/services.yaml file.

  2. Add the OpenSearch service with the version you need. For example, to use OpenSearch version 2.x, you might enter something like opensearch:2.0. Ensure you divide enough disk space in MB.

Step 2: Configure Relationships:

In your .magento.app.yaml file, set or verify the relationships properly to ensure they include your OpenSearch service. This step links your application with the OpenSearch service you've added.

Step 3: Deploy Your Changes:

  1. Commit your changes to your project's Git repository with an appropriate commit message, e.g., git commit -am Add OpenSearch service.

  2. Push your changes to trigger a deployment, e.g., git push.

Step 4: Access Your Environment:

After deployment, access your environment via Magento Cloud CLI or the Project Web Interface.

Step 5: Reindex Catalog Search:

Run the Magento indexer to reindex the Catalog Search index. You can achieve this, and the complete command will be installed bin/magento indexer:reindex catalogsearch_fulltext.

Step 6: Clear Cache

Clear the Magento cache to ensure your changes take effect immediately, using: bin/magento cache:clean.

FAQs

1. What is Magento Opensearch, and how is it related to Elasticsearch?

Magento Opensearch, an advanced search engine technology, relates to Elasticsearch. Designed for Magento 2, it offers a more secure and scalable version of Elasticsearch.


2. Can I continue to use Elasticsearch with Magento Open Source?

You can continue to use Elasticsearch with Magento Open Source. Yet, we recommend migrating to Opensearch for better performance and security features.


3. How do I reindex the catalog search after migrating to Opensearch?

After migrating to Opensearch, you can reindex the catalog search. You can do this by running the necessary commands provided in the Magento documentation. It ensures indexing all product data and making it available for search queries.


4. Is Magento Opensearch supported for Adobe Commerce on Cloud infrastructure?

Adobe Commerce on Cloud infrastructure supports Magento Opensearch. Enhance the search capabilities of your Adobe Commerce website by leveraging the power of Opensearch.


5. Can I switch from Elasticsearch to Opensearch on-premises installations?

Yes, you can switch from Elasticsearch to Opensearch on-premises installations. Ensure a smooth transition by following the migration guide provided by Magento.


6. Does Magento 2.4.6 support both Elasticsearch and Opensearch?

Magento 2.4.6 continues to support both Elasticsearch and Opensearch. Based on your specific requirements, you can choose between the two search engines.

Summary

Magento Opensearch is a free, open-source search tool based on Elasticsearch. It covers setting up OpenSearch, ensuring compatibility with Magento, and verifying everything works well. Here is an overview of what we covered:

  • Discover how Magento OpenSearch boosts search functionality, delivering swift and accurate results

  • A detailed guide on setup and Integration guide for Magento Open Search

  • Understand how OpenSearch integrates with Adobe Commerce on the Cloud.

Upgrade your site's search capabilities with Magento server hosting for enhanced user experience.

CTA

Andrea Oriane
Andrea Oriane
Technical Writer

Andrea specializes in creating informative content for Magento. With extensive e-commerce knowledge and understanding of Magento functionalities, she crafts articles for a wide range of audience.


Get the fastest Magento Hosting! Get Started