I have a document in ES. A field named "site" which is currently having value as "Elasticsearch". I want to update the value of this field to "stackOverFlow". I am using below script for the same.
"script": { "lang": "painless", "inline": "for (k in params.keySet()){if (!k.equals('ctx')){ctx._source.put(k, params.get(k))}}" }, "params":{ "site":"stackOverFlow" }
I am getting success in my response and the _version is getting increased by 1. But still my document is not getting updated. The value of site remains as "Elasticsearch".
NOTE : I am using ES version 6.4
Can anyone help me in figuring out where it goes wrong??