Using ES 5.6.3:
I am trying to update only one entry in an array.
For Example:
"myArray":[
"entry1",
"entry2"
]
I am trying to change the entry2 entry to entry3 and leave entry1 alone.
If I use
{"script": { "inline": "ctx_source.myArray = ['entry3']", "query": {"term": {"myArray":"entry2"}}}
It sets the entire array to entry3 and removes the entry1 item from the array.
Any example I can find only addresses objects in an array where an entire field is changed.