title: Delete only fields from all the documents that match my criteria
body: <p>To delete any field with value from all the documents without deleting the whole document from the Elasticsearch index usually I use <code>_update_by_query</code> API call with <code>script</code></p>
  
  <p><strong>For Ex:</strong> on <strong>my_properties</strong> index I want to delete all the fields e.g (key=>value) from all the documents where it exists. Using below query I'm able to delete all the <strong>feed</strong> field where it is exists but it this case the feed field is <strong>text/string</strong> type </p>
  
  <p><strong>Index</strong>: my_properties</p>
  
  <p><strong>Field</strong>: feed</p>
  
  <p><strong>Type</strong>: text</p>
  
  <p><strong>Example Value on feed:</strong>  <code>feed: ["AB-1234"]</code></p>
  
  <pre><code>POST my_properties/_update_by_query?refresh&amp;conflicts=proceed
  {
      "script" : "ctx._source.remove('feed')",
      "query" : {
          "exists": { "field": "feed" }
      }
  }
  </code></pre>
  
  <p>My main problem is when my field type is <strong>nested</strong> instead of <strong>text/string</strong></p>
  
  <p><strong>Index</strong>: my_properties</p>
  
  <p><strong>Field</strong>: feed_v2</p>
  
  <p><strong>Type</strong>: nested</p>
  
  <p><strong>Example Value on feed_v2:</strong>  <code>feed_v2: [{"feed":12},{"id":["AB-9999"]}]</code></p>
  
  <p><strong>Approach 1:</strong></p>
  
  <pre><code>POST my_properties/_update_by_query?refresh&amp;conflicts=proceed
  {
      "script" : "ctx._source.remove('feed_v2')",
      "query" : {
          "exists": { "field": "feed_v2" }
      }
  }
  </code></pre>
  
  <p><strong>Approach 2:</strong></p>
  
  <pre><code>POST my_properties/_update_by_query?refresh&amp;conflicts=proceed
  {
      "script" : "ctx._source.feed_v2.remove('feed')",
      "query" : {
          "exists": { "field": "feed_v2.feed" }
      }
  }
  </code></pre>
  
  <p>Nothing works, Am I missing something? Not sure but my guess is-</p>
  
  <pre><code>"query" : {"exists": { "field": "feed_v2" }}
  </code></pre>
  
  <blockquote>
    <p>query <strong>exists</strong> doesn't work <strong>same way with nested type field</strong> that's why it
    doesn't find anything while trying delete on <code>nested</code> type field</p>
  </blockquote>
  
  <p>As per the Ref: <a href="https://stackoverflow.com/a/53771354/1138192">https://stackoverflow.com/a/53771354/1138192</a> It should work for me but alas it doesn't work for me.</p>