我的操作:
父:国家,子:分支,孙:雇员
PUT /company { "mappings": { "branch": { "_parent": { "type": "country" } }, "employee": { "_parent": { "type": "branch" } } } }
我想添加一个孙子员工2,父母是分支:
PUT /company/employee2/_mapping { "employee2": { "_parent": { "type": "branch" } } }
我收到错误信息:
{ "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "无法添加指向已存在类型的 _parent 字段" } ], "type": "illegal_argument_exception" , "reason": "无法添加指向已存在类型的 _parent 字段" }, "status": 400 }
我不知道我该怎么办。有什么建议吗?谢谢。