It seems you can do something like:
{
"query": {
"bool": {
"filter": {
"term": {
"customer.id": "2"
}
}
}
},
"script": {
"lang": "painless",
"inline": "ctx._source.customer = params.customer",
"params": {
"customer": {
"id": 2,
"name": "CustJ4",
"anotherProperty" : {
"foo" :123,
"baz" : true
}
}
}
}
}
Which overrides the embedded/nested document (although this approach isn't documented so it's not clear if it is an officially supported approach).
It would be nice to be able to do a partial document update in a similar manor (without the complete override). Anyone got anything to say on this?
Thanks, Rob.