title: Elasticsearch update document with matching id
body: <p>I am trying to update the document in elasticsearch which matches the id field. If the <code>formData.id</code> matches any of the documents in elasticsearch, I want it's <code>mobile_number</code> and <code>primary_email_id</code> to be updated. I also want to insert a new field <code>website</code> to the matching result. For this, I tried the following query:</p>
  
  <pre><code>function updateForm(formData) {
  var deferred = Q.defer();
  client.update({
      index: 'collections',
      type: 'automobiles',
      id: '8s5WEbYZ6NUAliwOBf',
       body: {
              query: {
                  must: { 
                    match :  {
                        id: formData.id
                      } 
                  },
              },
              doc: {
                  'mobile_number' : formData.phone,
                  'primary_email_id': formData.email,
                  'website' : formData.website
              }
  
      }
  },function (error, response) {
      if(error){
          console.log(error);
          return error;
      }else {
          deferred.resolve(response);
      }
  
    }); 
    return deferred.promise;
  }
  </code></pre>
  
  <p>This gives me the following error:</p>
  
  <p><code>Error: [action_request_validation_exception] Validation Failed: 1: script or doc is missing;</code></p>
  
  <p>I already have a doc field in my query. What modifications should I make to perform such an update? Is there any other better way for such an operation?</p>