在对Magento 2中的产品目录重新编制索引期间, 请使用终端:
php bin/magento indexer:reindex
Catalog Search索引器过程将引发Elasticsearch错误:
Catalog Search indexer process unknown error:
{
"error":{
"root_cause":[
{
"type":"illegal_argument_exception", "reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."
}
], "type":"illegal_argument_exception", "reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true."
}, "status":400
}
此问题是由于在Magento 2中使用了不受支持的Elasticsearch版本引起的。例如, 通常会在安装Elasticsearch 7.x时发生, 但直到Magento仅支持5.x和6.x版本为止。
解
直到目前为止, 防止此异常出现在Magento 2的当前版本中的唯一解决方案是仅使用官方支持的Elasticsearch版本(6.x或5.x)。如果你使用的是Elasticsearch的最新版本, 例如magento不支持的7.x, 则每次重建搜索索引时都会出现该异常。
编码愉快!
评论前必须登录!
注册