Elasticsearch:由于之前创建的Index Templates未删除,导致创建Index时报错Root type mapping not empty after parsing
来源:互联网 发布:java电商项目源码 编辑:程序博客网 时间:2024/06/05 05:16
Elasticsearch版本:
1.7.1
故障
执行新建Index命令:PUT /hrms
报错:
{
"error": "MapperParsingException[mapping [candidate]]; nested: MapperParsingException[
Root type mapping not empty after parsing! Remaining fields: [experience : {type=float}
]]; ",
"status": 400
}
原因分析
难道是Index已经存在吗?于是尝试删除Index:
DELETE /hrms
报错:Index不存在?!
{
"error": "IndexMissingException[[hrms] missing]",
"status": 404
}
创建Index,报错信息中的“Remaining fields: [experience : {type=float}]”十分诡异,原因查找了很久,原来是之前创建的Index Templates没有删除。
PUT /_template/hrms-template{ "template": "hrms*", "mappings": { "candidate": { "experience": { "type": "float" } } }}
解决方案
执行以下命令删除Index templates即可:DELETE /_template/hrms-template
总结
Index templates有点类似于数据库中的触发器,会被隐蔽地自动执行,再加上ES报错不够清晰,因此容易引发一些问题。
本人是初学者,以上方法仅供参考。
0 0
- Elasticsearch:由于之前创建的Index Templates未删除,导致创建Index时报错Root type mapping not empty after parsing
- Elasticsearch Java API 之Index type mapping json创建修改
- Elasticsearch 2.3.2 创建index及type
- elasticsearch创建index和type操作日志记录
- Elasticsearch创建Index--java实现
- elasticsearch index 的 type 解释
- elasticsearch mapping index 说明
- elasticsearch 5.x删除index/type
- ElasticSearch Index templates属性描述
- elasticsearch 2.3.4 java API 连接,ik分词器,设置集群节点,创建index,mapping的几种方式
- elasticsearch index type
- 创建Index的命令
- 创建index之前如何确定其大小
- Elasticsearch学习笔记:index,mapping
- ElasticSearch: Index 和 Type 的区别
- MySQL - 性能优化 索引的创建、删除和查看 index
- MySQL索引的创建、删除 index creat/delete
- lucene对数据库创建索引时报错:java.io.IOException: Cannot overwrite: D:\index\_3.fdt的解决办法
- android SQLite 数据存储
- 数据结构实验之图论八:欧拉回路
- Netty系列之Netty百万级推送服务设计要点
- iOS ipa提交中断后无法再次提交
- 将整数数组进行m等分,使得每一个部分的和相等且m最大
- Elasticsearch:由于之前创建的Index Templates未删除,导致创建Index时报错Root type mapping not empty after parsing
- OpenVpn客户端所有流量经过服务器
- substring的带参用法——中国姓名的拆分
- 吊炸天!74款APP完整源码!
- 深度剖析之 PagerSlidingTabStrip
- HTTP 错误 500.24 - Internal Server Error的解决方法
- EF—主键冲突解决办法
- EF---结合三层方法的应用
- Leetcode 140 Word Break II