title: how to update in elastic search based on a string field
body: <p>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.</p>
  
  <pre><code>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"
   }
  }'
  </code></pre>
  
  <p>result:</p>
  
  <p>{
    "took" : 3,
    "timed_out" : false,
    "total" : 0,
    "updated" : 0,
    "batches" : 0,
    "version_conflicts" : 0,
    "noops" : 0,
    "retries" : 0,
    "failures" : [ ]
  }</p>
  
  <p>None of the records are getting updated.</p>
  
  <p>thanks in advance.</p>