升级到Elasticsearch 7时重新索引错误 [英] reindex error when upgrading to elasticsearch 7

查看:108
本文介绍了升级到Elasticsearch 7时重新索引错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们当前正在使用searchkick gem,它的效果很好.最近,我尝试在本地开发环境中将elasticsearch升级到7.我使用自制软件启动并运行它(研究后我需要运行 rm -fr/usr/local/var/lib/elasticsearch ).当我为一个模型重新索引时,出现以下映射错误:

We are currently using the searchkick gem and it works great. Recently I tried upgrading elasticsearch to 7 in my local development environment. I got it up and running using homebrew ( after researching that I needed to run rm -fr /usr/local/var/lib/elasticsearch). When I went to reindex one of my models I got the following mapping error:

Elasticsearch :: Transport :: Transport :: Errors :: BadRequest:[400] {错误":{"root_cause":[{类型":"mapper_parsing_exception",原因":根映射定义具有不受支持的参数:[化妆品/产品:{属性= {产品= {类型=关键字}}}}]]"类型":"mapper_parsing_exception",原因":无法解析映射[_doc]:根映射定义具有不受支持的参数:[化妆品/产品:{properties = {product = {type = keyword}}}]," caused_by:{" type:" mapper_parsing_exception,"原因:"根映射定义不受支持参数:[化妆品/产品:{属性= {产品= {类型=关键字}}}}},状态":400}

使用elasticsearch 6.8.4时不会发生此错误.谁能指出我解决该问题的资源?

This error does not occur when using elasticsearch 6.8.4. Can anyone point to me to a resource for resolving this issue?

推荐答案

版本7不支持映射类型.
要解决此问题,请删除所有映射类型(例如_doc)

Mapping type is not supported in version 7.
To solve this, remove all mapping types (_doc for example)

在Elasticsearch 6.0.0或更高版本中创建的索引只能包含一个映射类型.在5.x中创建的具有多种映射类型的索引将继续像在Elasticsearch 6.x中一样工作.类型将在Elasticsearch 7.0.0中的API中弃用,并在8.0.0中完全删除.

查看

这篇关于升级到Elasticsearch 7时重新索引错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆