i have a bank accounts dataset which have the fields account number,state,firstname,lastname.iam writing the following command to update all the firstname records of the customers from state CA to antony.
curl -XPOST 'localhost:9200/bank/_update_by_query?pretty' -d '{
"query" : {
"term" : {"state":"CA"}
},
"script" : {
"inline" : "ctx._source.firstname = a",
"params" : {
"a" : "antony"
},
"lang" : "groovy"
}
}'
result:
{ "took" : 3, "timed_out" : false, "total" : 0, "updated" : 0, "batches" : 0, "version_conflicts" : 0, "noops" : 0, "retries" : 0, "failures" : [ ] }
None of the records are getting updated.
thanks in advance.