我有这样的文档
"College": "UCLA",
"University": "American",
"Branch": "MECH",
"Name": {
"first": "john",
"middle": "william",
"last": "Richards"
}
我必须更新Name
组中的last
字段
我尝试了以下内容,但显示错误
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
}
您不允许您参考其中的点。您可以这样做:
POST alma/matter/1/_update
{
"doc": { "Name": {"last": "junior" }}
}