早些时候,我使用1.x版本,并使用下面的语法创建子对象映射。
"foo": {
"type": "integer",
"doc_values": true
},
"foo.bar": {
"type": "integer",
"doc_values": true
},
"foo.bar.baz": {
"type": "integer",
"doc_values": true
},但是现在,当我在es7.x中使用相同的映射语法时,我得到的错误如下:-
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Can't merge a non object mapping [foo] with an object mapping [foo]"
}
],
"type": "illegal_argument_exception",
"reason": "Can't merge a non object mapping [foo] with an object mapping [foo]"
},
"status": 400
}我来到这里,所以发布了无法将机器学习(Beta)模块中的非对象映射与对象映射错误合并,但是,注意到我不是在更新映射,相反,我正在处理一个新的映射,仍然会出现这个错误,请告诉我该怎么做?。
发布于 2019-06-19 09:13:26
对象类型的示例。请参阅这里获取更多信息
"mappings": {
"properties": {
"user": {
"properties": {
"age": { "type": "integer" },
"name": {
"properties": {
"first": { "type": "text" },
"last": { "type": "text" }
}
}
}
}
}在下面,可以将名称定义为对象,还可以使用name.firstname等添加进一步的属性。在映射中,foo是整数类型,然后是添加foo.bar,因此它会抛出错误。foo必须是对象类型。
"properties" : {
"name" : {
"type" : "object"
},
"name.firstname":{
"type" : "text"
},
"name.lastname":{
"type" : "text"
}
}https://stackoverflow.com/questions/56664005
复制相似问题