https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html
Consider:
PUT my_index
{
"mappings": {
"_doc": {
"properties": {
"user": {
"type": "nested"
}
}
}
}
}
PUT my_index/_doc/1
{
"group" : "fans",
"user" : [
{
"first" : "John",
"last" : "Smith"
},
{
"first" : "Alice",
"last" : "White"
}
]
}
When I run a painless script like:
ctx._source.user.add({
"first" : "Foo",
"last" : "Bar"
})
It is not working. I tried but cannot find any related documents or discussion started by other.