我有这样的文件
"College": "UCLA",
"University": "American",
"Branch": "MECH",
"Name": {
"first": "john",
"middle": "william",
"last": "Richards"
}
我必须更新last
群组中的Name
字段
我尝试了以下但是显示错误
POST alma/matter/1/_update
{
"doc": { "Name.last": "junior" }
}
错误:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Field name [Name.last] cannot contain '.'"
}
],
"type": "mapper_parsing_exception",
"reason": "Field name [Name.last] cannot contain '.'"
},
"status": 400
}
答案 0 :(得分:0)
您不允许引用带点的字段。你可以这样做:
POST alma/matter/1/_update
{
"doc": { "Name": {"last": "junior" }}
}