title: Delete specific docs in elasticsearch using python
body: <p>I am new to ElasticSearch. I am trying to delete a group of data from <em><a href="http://localhost:9200/es_index/es_type" rel="nofollow noreferrer">http://localhost:9200/es_index/es_type</a></em> using python.</p>
  
  <p>suppose <strong><code>x=['a','b','c','d','e','f']</code></strong> is a list of <strong><code>_ids</code></strong> that I want to delete</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>from elasticsearch import Elasticsearch 
  es = Elasticsearch()
  request_body = {
          "query": {
              "ids": {
                  "values": ['a','b','c','d','e','f']
              }
          }
      }
  es.delete_by_query(index=es_index, body=request_body)
  </code></pre>
  
  <p>But when I check <em><a href="http://localhost:9200/es_index/es_type" rel="nofollow noreferrer">http://localhost:9200/es_index/es_type</a></em> the data is still there.</p>