# Delete by query is not deleting documents from an Index

**URL:** <https://discuss.elastic.co/t/delete-by-query-is-not-deleting-documents-from-an-index/44360>\
**Category:** Elasticsearch\
**Created:** [March 14, 2016, 7:29pm UTC](https://discuss.elastic.co/t/delete-by-query-is-not-deleting-documents-from-an-index/44360 "2016-03-14T19:29:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [March 14, 2016, 7:29pm UTC](https://discuss.elastic.co/t/delete-by-query-is-not-deleting-documents-from-an-index/44360/1 "2016-03-14T19:29:01Z")

</div>

Hi Experts,

I did following in ES 1.7.1

> ```
> DELETE /prod-2016-03-09/AA/_query?pretty
> {
> "query": { "match": { "alertmsg": "monitor" } }
> }
> 
> ```

after this I am also getting  
{  
"\_indices": {  
"prod-2016-03-09": {  
"\_shards": {  
"total": 5,  
"successful": 5,  
"failed": 0  
}  
}  
}  
}

Before deleting my index doc count is 7089 and after delete command it is still 7089. Even I fire refresh API but still count is same . Can anyone suggest what I am doing wrong .

Thanks  
VG

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 15, 2016, 4:30am UTC](https://discuss.elastic.co/t/delete-by-query-is-not-deleting-documents-from-an-index/44360/2 "2016-03-15T04:30:39Z")

</div>

Do you have documents that match the query?

---

<div class="post-metadata">

**Author:** ![vikas\_gopal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikas_gopal/32/47661_2.png) [@vikas\_gopal](https://discuss.elastic.co/u/vikas_gopal)\
**Post date:** [March 16, 2016, 2:03am UTC](https://discuss.elastic.co/t/delete-by-query-is-not-deleting-documents-from-an-index/44360/3 "2016-03-16T02:03:52Z")

</div>

my bad I did not have the exact match which causes the issue . But is it recommended to use delete by query in a big index ? My index size is 1.5 TB.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 16, 2016, 3:00am UTC](https://discuss.elastic.co/t/delete-by-query-is-not-deleting-documents-from-an-index/44360/4 "2016-03-16T03:00:38Z")

</div>

You don't really have many other options!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:08pm UTC](https://discuss.elastic.co/t/delete-by-query-is-not-deleting-documents-from-an-index/44360/5 "2017-07-05T23:08:04Z")

</div>


