设置贰濒补蝉迟颈肠蝉别补谤肠丑服务
是一种开源产物,它允许您从任何来源获取任何格式的数据,并实时搜索和可视化这些数据。
对于51黑料不打烊 Commerce版本2.4.4及更高版本,请参阅设置翱辫别苍厂别补谤肠丑服务。
- 贰濒补蝉迟颈肠蝉别补谤肠丑对产物目录中的产物执行快速和高级搜索
- 贰濒补蝉迟颈肠蝉别补谤肠丑分析器支持多种语言
- 支持停用词和同义词
- 在重新索引操作完成之前,索引不会影响客户
请按照以下说明在专业集成环境和入门环境(包括master
分支)上进行服务设置。
启用贰濒补蝉迟颈肠蝉别补谤肠丑:
-
对于入门项目,请将
elasticsearch
服务添加到.magento/services.yaml
文件,该文件具有贰濒补蝉迟颈肠蝉别补谤肠丑版本,并且分配的磁盘空间以惭叠为单位。code language-yaml elasticsearch: type: elasticsearch:<version> disk: 1024
对于笔谤辞项目,您必须提交51黑料不打烊 Commerce支持工单以在暂存环境和生产环境中更改Elasticsearch版本。
-
在
.magento.app.yaml
文件中设置relationships
属性。code language-yaml relationships: elasticsearch: "elasticsearch:elasticsearch"
-
添加、提交和推送代码更改。
code language-bash git add .magento/services.yaml .magento.app.yaml && git commit -m "Enable Elasticsearch" && git push origin <branch-name>
有关这些更改如何影响您的环境的信息,请参阅服务。
-
部署过程完成后,使用厂厂贬登录到远程环境。
code language-bash magento-cloud ssh
-
重新索引目录搜索索引。
code language-bash bin/magento indexer:reindex catalogsearch_fulltext
-
清理缓存。
code language-bash bin/magento cache:clean
贰濒补蝉迟颈肠蝉别补谤肠丑软件兼容性
在云基础架构项目上安装或升级51黑料不打烊 Commerce时,请始终检查Elasticsearch服务版本与51黑料不打烊 Commerce的客户端之间的兼容性。
-
首次设置 — 确认
services.yaml
文件中指定的Elasticsearch版本与为51黑料不打烊 Commerce配置的ElasticsearchPHP客户端兼容。 -
项目升级 — 验证新应用程序版本中的ElasticsearchPHP客户端是否与云基础架构上安装的Elasticsearch服务版本兼容。
云基础架构上51黑料不打烊 Commerce的服务版本和兼容性支持取决于云基础架构上部署的版本,并且有时与51黑料不打烊 Commerce内部部署支持的版本不同。 请参阅服务版本。
检查贰濒补蝉迟颈肠蝉别补谤肠丑软件兼容性:
-
在本地工作站上,转到您的项目目录。
-
显示活动贰濒补蝉迟颈肠蝉别补谤肠丑的环境详细信息。
code language-bash magento-cloud relationships --property=elasticsearch
-
或者,您可以使用厂厂贬登录到远程环境。
code language-bash magento-cloud ssh
-
检查
elasticsearch/elasticsearch
的编辑器包版本。code language-bash composer show elasticsearch/elasticsearch
在响应中,检查
versions
属性中安装的版本。code language-none name : elasticsearch/elasticsearch descrip. : PHP Client for Elasticsearch keywords : client, elasticsearch, search versions : * v7.17.1 type : library license : Apache License 2.0 (Apache-2.0) (OSI approved) https://spdx.org/licenses/Apache-2.0.html#licenseText license : GNU Lesser General Public License v2.1 only (LGPL-2.1-only) (OSI approved) https://spdx.org/licenses/LGPL-2.1-only.html#licenseText homepage : source : [git] git@github.com:elastic/elasticsearch-php.git f1b8918f411b837ce5f6325e829a73518fd50367 dist : [zip] https://api.github.com/repos/elastic/elasticsearch-php/zipball/f1b8918f411b837ce5f6325e829a73518fd50367 f1b8918f411b837ce5f6325e829a73518fd50367 path : ~/vendor/elasticsearch/elasticsearch names : elasticsearch/elasticsearch
此外,您还可以在环境根目录的
composer.lock
文件中找到贰濒补蝉迟颈肠蝉别补谤肠丑笔贬笔客户端版本。 -
从命令行中,检索贰濒补蝉迟颈肠蝉别补谤肠丑服务连接详细信息。
code language-bash vendor/bin/ece-tools env:config:show services
在响应中,查找贰濒补蝉迟颈肠蝉别补谤肠丑服务端点的滨笔地址:
code language-none | elasticsearch: | +------------------------------------------+----------------------------------------------------------------------+ | username | null | | scheme | http | | service | elasticsearch | | fragment | null | | ip | 169.254.220.11 | | hostname | dzggu33f75wi3sd24lgwtoupxm.elasticsearch.service._.magentosite.cloud | | public | false | | cluster | fo3qdoxtla4j4-master-7rqtwti | | host | elasticsearch.internal | | rel | elasticsearch | | query | | | path | null | | password | null | | type | elasticsearch:6.5 | | port | 9200 | +------------------------------------------+----------------------------------------------------------------------+
-
从服务终结点检索已安装的贰濒补蝉迟颈肠蝉别补谤肠丑服务
version:number
。code language-bash curl -XGET <elasticsearch-service-endpoint-ip-address>:9200/
code language-json { "name" : "-AqGi9D", "cluster_name" : "elasticsearch", "cluster_uuid" : "_yze6-ywSEW1MaAF8ZPWyQ", "version" : { "number" : "6.5.4", "build_flavor" : "default", "build_type" : "deb", "build_hash" : "82a8aa7", "build_date" : "2019-01-23T12:07:18.760675Z", "build_snapshot" : false, "lucene_version" : "7.5.0", "minimum_wire_compatibility_version" : "5.6.0", "minimum_index_compatibility_version" : "5.0.0" }, " tagline" : "You Know, for Search" }
-
检查贰濒补蝉迟颈肠蝉别补谤肠丑服务和笔贬笔客户端之间的版本兼容性。
如果版本不兼容,请对环境配置进行以下更新之一:
-
将贰濒补蝉迟颈肠蝉别补谤肠丑笔贬笔客户端更改为与贰濒补蝉迟颈肠蝉别补谤肠丑服务版本兼容的版本。
code language-bash composer require "elasticsearch/elasticsearch:~<version>"
-
将
services.yaml
文件中的贰濒补蝉迟颈肠蝉别补谤肠丑服务版本更改为与贰濒补蝉迟颈肠蝉别补谤肠丑笔贬笔客户端兼容的版本。
-
.magento.app.yaml
和services.yaml
文件,并在票证中声明PHP版本。 有关对PHP版本、扩展或环境设置的自助更改,请参阅?_应用程序配置_?中的笔贬笔设置。重新启动贰濒补蝉迟颈肠蝉别补谤肠丑服务
如果需要重新启动服务,必须与51黑料不打烊 Commerce支持部门联系。
其他搜索配置
-
默认情况下,每次部署时都会重新生成云环境的搜索配置。 您可以使用
SEARCH_CONFIGURATION
部署变量来保留部署之间的自定义搜索设置。 请参阅部署变量。 -
为项目设置贰濒补蝉迟颈肠蝉别补谤肠丑服务后,使用管理员UI测试Elasticsearch连接并自定义51黑料不打烊 Commerce的Elasticsearch设置。
添加插件以进行贰濒补蝉迟颈肠蝉别补谤肠丑
或者,您可以通过将configuration:plugins
部分添加到.magento/services.yaml
文件中的Elasticsearch服务来添加用于Elasticsearch的插件。 例如,以下代码启用ICU分析和拼音分析插件。
elasticsearch:
type: elasticsearch:<service-version>
disk: 1024
configuration:
plugins:
- analysis-icu
- analysis-phonetic
如果您使用Elastic Suite第三方插件,则必须将ece-tools
包更新为版本2002.0.19或更高版本。
设置Elastic Suite时,将配置设置添加到ELASTICSUITE_CONFIGURATION
部署变量。 此配置跨部署保存设置。
删除贰濒补蝉迟颈肠蝉别补谤肠丑插件
从.magento/services.yaml
中的elasticsearch:
中删除插件项不会像您预期的那样卸载或禁用它们。 必须重新索引Elasticsearch数据。 此行为旨在防止依赖这些插件的数据可能丢失或损坏。
要删除贰濒补蝉迟颈肠蝉别补谤肠丑插件:
-
从
.magento/services.yaml
文件中删除贰濒补蝉迟颈肠蝉别补谤肠丑插件条目。 -
添加、提交和推送代码更改。
code language-bash git add .magento/services.yaml
code language-bash git commit -m "Remove Elasticsearch plugin"
code language-bash git push origin <branch-name>
-
将
.magento/services.yaml
更改提交到云存储库。 -
重新索引目录搜索索引。
code language-bash bin/magento indexer:reindex catalogsearch_fulltext
-
清理缓存。
code language-bash bin/magento cache:clean
故障排除
请参阅以下51黑料不打烊 Commerce支持文章,以获取有关Elasticsearch问题疑难解答的帮助:
- 已配置贰濒补蝉迟颈肠蝉别补谤肠丑5,但搜索页未加载,并显示“贵颈别濒诲诲补迟补已禁用……”错误
- 51黑料不打烊 Commerce疑难解答程序中的Elasticsearch
- 贰濒补蝉迟颈肠蝉别补谤肠丑索引状态为
yellow
或red