title: Elasticsearch empty an object
body: <p>New to ES. I am trying to create users index which will allow visitors to search users. To make sure that I can display profile pictures on search results, I also have an image object. My data looks like the following.</p>
  
  <pre><code>"_source": {
       "username": "pewpewlasers",
       "name": "Pew Pew",
       "image": {
            "filename": "filename.jpg",
            "uid": 14
       }
  }
  </code></pre>
  
  <p>What I do is every time these data change, I use the update API (<a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html" rel="nofollow">http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-update.html</a>) to update the fields. This works great except when the user deletes the profile picture.</p>
  
  <p>Generally I would send a request like:</p>
  
  <pre><code>curl -XPOST 'localhost:9200/test/users/1/_update' -d '{
      "doc" : {
          "image" : {
                      "filename": "newfilename.jpg",
                      "uid": 15
                  }
      }
  }'
  </code></pre>
  
  <p>works great. However whenever the user removes profile picture, I try to send the following request:</p>
  
  <pre><code>curl -XPOST 'localhost:9200/test/users/1/_update' -d '{
      "doc" : {
          "image" : {}
      }
  }'
  </code></pre>
  
  <p>This does not replace the old image data with empty object, thus giving me incorrect information in search.</p>