无法在弹性搜索中更新映射



我一直在尝试更新映射,但无法完成。这个问题主要与更新嵌套零件有关。假设有一个字段";Anand"它包含一个字段";你好";

{
"properties": {
"anand": {
"hello": {
"type": "short"
}
}
}
}

但是我得到错误

"error" : {
"root_cause" : [
{
"type" : "mapper_parsing_exception",
"reason" : "No type specified for field [anand]"
}
],
"type" : "mapper_parsing_exception",
"reason" : "No type specified for field [anand]"
},
"status" : 400
}

当前映射为

{
"anandschool" : {
"mappings" : {
"properties" : {
"anand" : {
"type" : "nested"
},
"doc" : {
"properties" : {
"properties" : {
"properties" : {
"shop_tier" : {
"type" : "long"
}
}
}
}
},
"message" : {
"type" : "byte"
},
"properties" : {
"properties" : {
"shop_tier" : {
"type" : "long"
},
"shop_type" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"shop" : {
"type" : "long"
}
}
}
}
}

我甚至创建了一个嵌套类型anand,这样它就可以工作

{
"properties": {
"anand": {
"type": "nested"
}
}
}

自助

当更新嵌套的映射时,需要更新嵌套字段的属性。

对于更新的上述示例

"properties": {
"anand": {
"properties":{
"hello": {
"type": "short"
}
}
}
}
}

THough这在嵌套的字段中不起作用。Ex if anand类型为";嵌套";,这是行不通的。若有人知道解决方案,请告诉我。

最新更新