The OpenSearch service is an open-source fork of Elasticsearch 7.10.2, following the licensing changes for Elasticsearch. See the OpenSource Project in GitHub.
Elasticsearch 7.11 and later is not supported for Adobe Commerce on cloud infrastructure. Adobe Commerce versions 2.3.7-p3, 2.4.3-p2, and 2.4.4 and later support the OpenSearch service. The on-premises installations continue to support Elasticsearch.
OpenSearch enables you to take data from any source, any format, and search and visualize it in real time.
Use the following instructions for service setup on Pro Integration environments and Starter environments, including the master
branch.
Submit an Adobe Commerce Support ticket to change the service configuration on Pro Production and Staging environments.
Adobe recommends that you always set up OpenSearch for your Adobe Commerce on cloud infrastructure project even if you plan to configure a third-party search tool for your Adobe Commerce application. Setting up OpenSearch provides a fallback option if the third-party search tool fails.
To enable OpenSearch:
For Starter and Pro integration environments, add the opensearch
service to the .magento/services.yaml
file with the appropriate version and allocated disk space in MB. In this case, version 2 is appropriate. The minor version is not required because cloud infrastructure uses the latest version of OpenSearch.
opensearch:
type: opensearch:2
disk: 1024
For Pro projects, you must Submit an Adobe Commerce Support ticket to change the OpenSearch version in the Staging and Production environments.
Set or verify the relationships
property in the .magento.app.yaml
file.
relationships:
opensearch: "opensearch:opensearch"
Add, commit, and push code changes.
git add .magento/services.yaml .magento.app.yaml
git commit -m "Enable OpenSearch"
git push origin <branch-name>
For information on how these changes affect your environments, see Configure services.
After the deployment process completes, use SSH to log in to the remote environment.
magento-cloud ssh
Reindex the Catalog Search index.
bin/magento indexer:reindex catalogsearch_fulltext
Clean the cache.
bin/magento cache:clean
After initial service setup, you can change the software version for an installed service by updating the services.yaml
and .magento.app.yaml
configuration files. See Change service version.
When you install or upgrade your Adobe Commerce on cloud infrastructure project, always check for compatibility between the OpenSearch service version and the OpenSearch PHP client for Adobe Commerce.
First time setup–Confirm that the OpenSearch version specified in the services.yaml
file is compatible with the OpenSearch PHP client configured for Adobe Commerce.
Project upgrade–Verify that the OpenSearch PHP client in the new application version is compatible with the OpenSearch service version installed on the cloud infrastructure.
Service version and compatibility support is determined by versions tested and deployed on the Cloud infrastructure, and sometimes differ from versions supported by Adobe Commerce on-premises deployments. See System requirements in the Installation Guide for a list of supported versions.
To verify OpenSearch software compatibility:
On your local workstation, change to your project directory.
Show the OpenSearch details for the active environment.
magento-cloud relationships --property=opensearch
Alternatively, you can use SSH to log in to the remote environment.
magento-cloud ssh
Retrieve the OpenSearch service connection details.
vendor/bin/ece-tools env:config:show services
In the response, find the IP address and port for the OpenSearch service endpoint:
+------------------------------------------+--------------------------------------------------------+
| opensearch: |
+------------------------------------------+--------------------------------------------------------+
| username | null |
| scheme | http |
| service | opensearch |
| fragment | null |
| ip | 169.254.220.11 |
| hostname | hostf75wi3sd24l.opensearch.service._.magentosite.cloud |
| port | 9200 |
| cluster | projectID-develop-4ranwui |
| host | opensearch.internal |
| rel | opensearch |
| path | null |
| query | |
| password | null |
| type | opensearch:2 |
| public | false |
| host_mapped | false |
Retrieve the installed OpenSearch service version:number
from the service endpoint.
curl -XGET <opensearch-service-endpoint-ip-address>:9200
{
"name" : "opensearch.0",
"cluster_name" : "opensearch",
"cluster_uuid" : "_yzaae6-ywSEW1MaAF8ZPWyQ",
"version" : {
"distribution" : "opensearch",
"number" : "2.5.0",
"build_type" : "deb",
"build_hash" : "aaaaaaa",
"build_date" : "2023-01-23T12:07:18.760675Z",
"build_snapshot" : false,
"lucene_version" : "9.4.2",
"minimum_wire_compatibility_version" : "7.10.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "The OpenSearch Project: https://opensearch.org/"
}
For Pro projects, you must submit an Adobe Commerce Support ticket to install or update services in Staging and Production environments. Indicate the service changes needed and include your updated .magento.app.yaml
and services.yaml
files and PHP version in the ticket. For changes to a live Production environment, you must provide a minimum of 48 hours notice. It can take up to 48 hours for the Cloud infrastructure team to update your project.
If you need to restart the OpenSearch service, you must contact Adobe Commerce support.
By default, the search configuration for Cloud environments regenerates each time you deploy. You can use the SEARCH_CONFIGURATION
deploy variable to retain custom search settings between deployments. See Deploy variables.
After you set up the OpenSearch service for your project, use the Admin UI to test the OpenSearch connection and customize OpenSearch settings for Adobe Commerce.
Optionally, you can add plugins for OpenSearch by adding the configuration:plugins
section to the OpenSearch service in the .magento/services.yaml
file. For example, the following code enables the ICU analysis and Phonetic analysis plugins.
opensearch:
type: opensearch:2
disk: 1024
configuration:
plugins:
- analysis-icu
- analysis-phonetic
See the OpenSearch Project for more information on plugins.
Removing the plugin entries from the opensearch:
section of the .magento/services.yaml
file does not uninstall or disable the service. To fully disable the service, you must reindex your OpenSearch data after removing the plugins from your .magento/services.yaml
file. This design prevents the possible loss or corruption of data that depends on these plugins.
To remove OpenSearch plugins:
Remove the OpenSearch plugin entries from your .magento/services.yaml
file.
Add, commit, and push your code changes.
git add .magento/services.yaml
git commit -m "Remove OpenSearch plugin"
git push origin <branch-name>
Commit the .magento/services.yaml
changes to your cloud repository.
Reindex the Catalog Search index.
bin/magento indexer:reindex catalogsearch_fulltext
Clean the cache.
bin/magento cache:clean