Elasticsearch delete_by_query wrong usage
<p>
I am using 2 similar ES methods to load and delete documents:</p>

<pre><code>result = es.search(index='users_favourite_documents',
                   doc_type='favourite_document',
                   body={"query": {"match": {'user': user}}})
</code></pre>

<p>And:</p>

<pre><code>result = es.delete_by_query(index='users_favourite_documents',
                            doc_type='favourite_document',
                            body={"query": {"match": {'user': user}}})
</code></pre>

<p>First one works ok and returns expected records.<br>
Second one throws Exception:</p>

<blockquote>
  <p>"TransportError(404,'{<br>
  \"found\":false,<br>
  \"_index\":\"users_favourite_documents\",<br>
  \"_type\":\"favourite_document\",<br>
  \"_id\":\"_query\",
  \"_version\":1,<br>
  \"_shards\":{\"total\":2,\"successful\":2,
  \"failed\":0}}')"</p>
</blockquote>

<p>What am I doing wrong?</p>