elasticsearch-py 2.4.0 for python does not contain delete_by_query() function.
<p>elasticsearch-py 2.4.0 for python does not contain delete_by_query() function. So How can I delete documents based on the query in elasticsearch 2.4.0 library?</p>

<p>From Elasticsearch version 2.x, delete_by_query feature has been removed and moved as plugin. Reference <a href="https://www.elastic.co/guide/en/elasticsearch/plugins/current/delete-by-query-plugin-reason.html" rel="nofollow">here</a></p>

<p>If you want to delete multiple documents using python, use <a href="http://elasticsearch-py.readthedocs.io/en/master/helpers.html" rel="nofollow">bulk helpers</a></p>

<p>Generate the list of document ids using search query and pass the list to bulk delete.</p>

python django elasticsearch