0
我想添加一个新字段&也需要从嵌套字段中删除该字段。如何添加和删除嵌套文档中的字段
这里是我的映射
PUT nestedtest/_mapping/nestedtype
{
"properties": {
"name":{
"type": "text"
},
"address":{
"type": "nested",
"properties": {
"city":{
"type":"text"
}
}
}
}
}
现在我想添加一个新的领域在**address nested path
,像**国家= India` 然后我需要删除目前在全国字段中的数据i..e 印度不乡间田野
我试着用这个
POST /nestedtest/nestedtype/1/_update?pretty
{
"script": {
"lang": "painless",
"inline": "ctx._source.address=params.country",
"params": {
"country":{
"country":"India"
}
}
}
}
但是,这是从地址删除以前的字段城市嵌套的路径。