title: Elasticsearch 2.1: how to delete by query using curl
body: <p>I have an _index: varnish_logs and _type: varnish</p>
  
  <p>a field having two different values "server" : "india" and "server" : "usa"</p>
  
  <p>Now I want to delete only the records which are in usa.</p>
  
  <p>I tried using   </p>
  
  <p>$ curl -XDELETE '<a href="http://localhost:9200/_all/_query?q=server:usa" rel="noreferrer">http://localhost:9200/_all/_query?q=server:usa</a>'</p>
  
  <p>response: No handler found for uri [] and method [DELETE]</p>
  
  <p><a href="https://i.stack.imgur.com/jvS5t.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jvS5t.png" alt="enter image description here"></a>
  and also tried to delete all the data using query</p>
  
  <p><code>curl -XDELETE 'http://localhost:9200/varnish_logs/varnish/_query' -d '</code>
  <code>{</code>
     <code>"query" :{</code>
          <code>"match_all" : {}</code>
      <code>}</code>
  <code>}'</code></p>
  
  <p>all I get response: found: "false"
   <a href="https://i.stack.imgur.com/KQNKY.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KQNKY.png" alt="enter image description here"></a></p>
  
  <p>Please let me know where I'm wrong</p>