I am using 2 similar ES methods to load and delete documents:
result = es.search(index='users_favourite_documents',
doc_type='favourite_document',
body={"query": {"match": {'user': user}}})
And:
result = es.delete_by_query(index='users_favourite_documents',
doc_type='favourite_document',
body={"query": {"match": {'user': user}}})
First one works ok and returns expected records.
Second one throws Exception:
"TransportError(404,'{
\"found\":false,
\"_index\":\"users_favourite_documents\",
\"_type\":\"favourite_document\",
\"_id\":\"_query\", \"_version\":1,
\"_shards\":{\"total\":2,\"successful\":2, \"failed\":0}}')"
What am I doing wrong?