有个nested字段需要批量部分更新,但是不知道painless该怎么写,求大神指教
POST usercenter/cust/_update_by_query?conflicts=proceed
{
"query": {
"match_all":{}
},
"script":{
"lang":"painless",
"inline":"ctx['_source'].nestedfield.field=1"
}
}
mapping:
{
"usercenter-v1": {
"mappings": {
"cust": {
"_all": {
"enabled": false
},
"properties": {
"bd_user_app": {
"type": "nested",
"properties": {
"field": {
"type": "integer"
}
}
}
}
}
}
}
}
POST usercenter/cust/_update_by_query?conflicts=proceed
{
"query": {
"match_all":{}
},
"script":{
"lang":"painless",
"inline":"ctx['_source'].nestedfield.field=1"
}
}
mapping:
{
"usercenter-v1": {
"mappings": {
"cust": {
"_all": {
"enabled": false
},
"properties": {
"bd_user_app": {
"type": "nested",
"properties": {
"field": {
"type": "integer"
}
}
}
}
}
}
}
}
1 个回复
rochy - rochy_he
赞同来自: