尽管安装了OpenSearch,Elasticsearch仍显示为搜索引擎
本文针对以下问题提供了解决方案:即使安装或升级到OpenSearch,Elasticsearch仍显示为云上Adobe Commerce的搜索引擎。
描述 description
环境
Adobe Commerce on cloud 2.4.4 - 2.4.5-p11
注意: OpenSearch可用作从Adobe Commerce 2.4.6开始的搜索引擎。
问题/症状
即使安装或升级到OpenSearch后,Elasticsearch仍显示为云中Adobe Commerce的搜索引擎。
重现步骤:
- 转到 商店
>
配置>
目录>
目录搜索。 - 检查搜索引擎。 将显示Elasticsearch7。
原因
Elasticsearch7在Adobe Commerce中硬编码为在这些版本中使用的搜索引擎。
请不要将其与安装的服务版本混淆。 即使代码中未包含Opensearch模块,Adobe Commerce也可以使用底层Opensearch服务。
解决方法 resolution
要验证是否已安装OpenSearch,请运行以下命令:
方法1:
-
在服务器上运行以下命令:
curl 127.0.0.1:9200
。 它应返回OpenSearch及其版本。code language-none $ curl 127.0.0.1:9200 { "name" : $clusterName, "cluster_name" : "opensearch_stg", "cluster_uuid" : $clusterUuid, "version" : { "distribution" : "opensearch", "number" : "1.2.4", "build_type" : "deb", "build_hash" : "44ccdbaed5fe5a8b02d99a611857a671b6dd909d", "build_date" : "2022-11-08T09:23:45.993372Z", "build_snapshot" : false, "lucene_version" : "8.10.1", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0-beta1" }, "tagline" : "The OpenSearch Project: https://opensearch.org/" }
方法2:
- 在Magento-cloud CLI上使用以下命令:
magento-cloud relationships -p <project_id>
。 使用该命令后,找到OpenSearch。
3d58f420-19b5-47a0-a122-5c9dab55ec7f