本文在新建类型的时候报如下错误:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [myes] as the final mapping would have more than 1 type: [user1, user]"
}
],
"type": "illegal_argument_exception",
"reason": "Rejecting mapping update to [myes] as the final mapping would have more than 1 type: [user1, user]"
},
"status": 400
}
在springboot启动的时候也报对应的错误:
Caused by: java.lang.IllegalArgumentException: Rejecting mapping update to [myes] as the final mapping would have more than 1 type: [topic, user]
然后发现,elasticsearch 6.0.0及之后移除了一个索引允许映射多个类型的操作(Removal of mapping types)。也就是不能用索引跟数据库的database相对比,类型跟表对比了,这样会产生误解。具体原因以后会详细研究。先记录下来。