I am trying to conditionally update nested object, but some how not able to do it.
My index mapping looks like
PUT in_index
{
"mappings": {
"tyepe_index": {
"properties": {
"name":{
"type": "text"
},
"id":{
"type": "text"
},
"statuses": {
"type": "nested",
"properties": {
"status":{
"type":"text"
},
"time":{
"type":"date",
"format":"epoch_millis"
}
}
}
}
}
}
}
and my nested data looks like
"statuses": [
{
"status": "abc",
"time": "15066024220000"
},
{
"status": "bef",
"time": "1506602422000"
},
{
"time": "1506602422023",
"status": "ghi"
},
]
I want to append status:xyz to existing nested values if the time of status:abc is less the staus:xyz time.