title: How to really delete document of a certain type in elasticsearch
body: <p>I would like to delete all of my document of _type=varnish-request on my elasticsearch.
  I installed the delete by query plugin (<a href="https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/plugins-delete-by-query.html" rel="nofollow noreferrer">https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/plugins-delete-by-query.html</a>)</p>
  
  <p>I did DELETE <a href="http://localhost:9200/logstash" rel="nofollow noreferrer">http://localhost:9200/logstash</a>*/_query</p>
  
  <pre><code>{
    "query": {
      "bool": {
        "must": [        
          { "match": {"_type":"varnish-request"}},
          { "match": {"_index":"logstash-2016.02.05"}}     
        ]
      }
    }
  }
  </code></pre>
  
  <p>And it's OK</p>
  
  <pre><code>{"took":2265842,"timed_out":false,"_indices":{"_all":{"found":3062614,"deleted":3062614,"missing":0,"failed":0},"logstash-2016.02.05":
  {"found":3062614,"deleted":3062614,"missing":0,"failed":0}},"failures":[]}
  </code></pre>
  
  <p>curl <a href="http://localhost:9200/_cat/indices" rel="nofollow noreferrer">http://localhost:9200/_cat/indices</a> | sort
  Before the clean</p>
  
  <ul>
  <li>yellow open logstash-2016.02.05 5 1 4618245 0   4.1gb   4.1gb</li>
  </ul>
  
  <p>After the clean</p>
  
  <ul>
  <li>yellow open logstash-2016.02.05 5 1 1555631 3062605 4.1gb 4.1gb</li>
  </ul>
  
  <p>The whole point is to 'light' my ES server by removing useless data. But here I see that the index size is still the same.</p>
  
  <p>I already check <a href="https://stackoverflow.com/questions/19013895/delete-documents-of-type-in-elasticsearch">Delete documents of type in Elasticsearch</a> but no luck</p>
  
  <p>I try with <a href="https://stackoverflow.com/questions/20608417/elasticsearch-how-to-free-store-size-after-deleting-documents">elasticsearch: how to free store size after deleting documents</a></p>
  
  <p>POST <a href="http://localhost:9200/logstash-2016.02.05/_forcemerge" rel="nofollow noreferrer">http://localhost:9200/logstash-2016.02.05/_forcemerge</a></p>
  
  <pre><code>{"_shards":{"total":10,"successful":5,"failed":0}}
  </code></pre>
  
  <p>But still </p>
  
  <ul>
  <li>yellow open logstash-2016.02.05 5 1 1555631 3062605 4.1gb 4.1gb</li>
  </ul>