title: Bulk delete elasticsearch
body: <p>i am using elastic search 2.2. </p>
  
  <p>here is the count of documents</p>
  
  <p>curl 'xxxxxxxxx:9200/_cat/indices?v'</p>
  
  <pre><code>yellow open   app                 5   1   28019178         5073     11.4gb         11.4gb
  </code></pre>
  
  <p>In the "app" index we have two types of document. </p>
  
  <ol>
  <li>"log"</li>
  <li>"syslog"</li>
  </ol>
  
  <p>Now i want to delete all the documents under type "syslog".</p>
  
  <p>Hence, i tried using the following command </p>
  
  <pre><code> curl -XDELETE "http://xxxxxx:9200/app/syslog"
  </code></pre>
  
  <p>But am getting the following error</p>
  
  <pre><code>No handler found for uri [/app/syslog]
  </code></pre>
  
  <p>i have installed delete-by-query plugin as well. Is there any way i can do a bulk delete operation ?</p>
  
  <p>For now , i am deleting records by fetching the id.</p>
  
  <pre><code>curl -XDELETE "http://xxxxxx:9200/app/syslog/A121312"
  </code></pre>
  
  <p>it took around 5 mins for me to delete 10000 records. i have more than 1000000 docs which needs to be deleted. please help. </p>
  
  <p>[EDIT -1]</p>
  
  <p>i ran the below query to delete syslog type docs </p>
  
  <pre><code>curl -XDELETE 'http://xxxxxx:9200/app/syslog/_query' -d'
  {
    "query": {
      "bool": {
        "must": [
          {
            "match_all": {}
          }
        ]
      }
    }
  }'
  </code></pre>
  
  <p>And result is below </p>
  
  <pre><code>{"found":false,"_index":"app","_type":"syslog","_id":"_query","_version":1,"_shards":{"total":2,"successful":1,"failed":0}}
  </code></pre>
  
  <p>i used to query to get this message from index</p>
  
  <pre><code> {
        "_index" : "app",
        "_type" : "syslog",
        "_id" : "AVckPMQnKYIebrQhF556",
        "_score" : 1.0,
        "_source" : {
          "message" : "some test message",
          "@version" : "1",
          "@timestamp" : "2016-09-13T15:49:04.562Z",
          "type" : "syslog",
          "host" : "1.2.3.4",
          "priority" : 0,
          "severity" : 0,
          "facility" : 0,
          "facility_label" : "kernel",
          "severity_label" : "Emergency"
  }
  </code></pre>
  
  <p>[EDIT 2]</p>
  
  <p>Delete by query listed as plugin</p>
  
  <pre><code>sudo /usr/share/elasticsearch/bin/plugin list
  Installed plugins in /usr/share/elasticsearch/plugins/node1:
      - delete-by-query
  </code></pre>