当前位置: 首页 >服务端 > Elasticsearch:No handler for type [string]...与Rejecting mapping update to [hn] as the final mapping would have more than 1 type异常处理

Elasticsearch:No handler for type [string]...与Rejecting mapping update to [hn] as the final mapping would have more than 1 type异常处理

报错原因

我的Elasticsearch是"6.4.0"版本,当我创建字段时

{"domain":{"type": "string","index": "not_analyzed"}}

 

原因分析

查看官方文档后发现是在新版本中已经移除该操作方式了

Elasticsearch从5.X就引入了textkeyword,其中keyword适用于不分词字段,搜索时只能完全匹配,这时string还保留着。 
到了6.X就彻底移除string了。 
另外,"index"的值只能是boolean变量了。

解决方法

修改为

{"domain":{"type":"text","index":"false"},}

 

出现的第二个问题

1. 此时抛出了另外一个error

{"type": "illegal_argument_exception","reason": "Rejecting mapping update to [hn] as the final mapping would have more than 1 type: [poll, job, story]"}

 

2. 这个异常引发的原因同样是版本问题

  
  在Elasticsearch 6.0.0或更高版本中创建的索引可能只包含单个mapping type
在具有多种映射类型的5.x中创建的索引将继续像以前一样在Elasticsearch 6.x中运行。映射类型将在Elasticsearch 7.0.0中完全删除。

 

作者:twoseee
来源链接:https://www.cnblogs.com/tcppdu/p/9598121.html

版权声明:
1、JavaClub(https://www.javaclub.cn)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaclub.cn/server/117312.html

标签:Mapping
分享给朋友:

“Elasticsearch:No handler for type [string]...与Rejecting mapping update to [hn] as the final mapping would have more than 1 type异常处理” 的相关文章

Python基础知识 2022年05月16日 21:27:39
划分子网和构造超网的学习 2022年05月17日 13:57:19
[C#]richtextbox实现拖放 2022年05月17日 20:25:47
[Multimedia][TS]TS流的解析 2022年05月17日 20:41:26
[C#][控件]常用控件命名规范 2022年05月17日 20:45:24
centos7中 yum的安装 2022年05月19日 19:54:29
投票统计,遍历数据 2022年05月21日 11:41:42
学习go语言国内最全资料链接 2022年05月23日 21:27:32
项目ITP(三) 玩玩 服务端 到 app端 2022年05月26日 21:10:00