# Delete by query stuck after installing plugin

**URL:** <https://discuss.elastic.co/t/delete-by-query-stuck-after-installing-plugin/51837>\
**Category:** Elasticsearch\
**Created:** [June 3, 2016, 10:12pm UTC](https://discuss.elastic.co/t/delete-by-query-stuck-after-installing-plugin/51837 "2016-06-03T22:12:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arpan](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@arpan](https://discuss.elastic.co/u/arpan)\
**Post date:** [June 3, 2016, 10:12pm UTC](https://discuss.elastic.co/t/delete-by-query-stuck-after-installing-plugin/51837/1 "2016-06-03T22:12:40Z")

</div>

I installed the delete-by-query plugin for elasticsearch 2.3. and I am running a time query and unable to get the query to run. It just gets stuck before timing out. Has anyone encountered something similar?

This is what my query looks like:

curl -XDELETE "[http://localhost:9200/index/logline/\_query](http://localhost:9200/index/logline/_query)" -d'  
{  
"query": {  
"range" : {  
"timestamp" : {  
"gte" : "now-90d/d",  
"lt" : "now-7d/d"  
}  
}  
}  
}'

I haven't been able to find any documentation to begin to debug this

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 4, 2016, 6:44am UTC](https://discuss.elastic.co/t/delete-by-query-stuck-after-installing-plugin/51837/2 "2016-06-04T06:44:32Z")

</div>

May be @tlrx knows?

That said, you should better use daily indices instead of removing so many documents.  
DELETE generates a lot of IO and could take a loooong time to run.  
Dropping an index is instantaneous!

My 2 cents

---

<div class="post-metadata">

**Author:** ![tanguy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy/32/6030_2.png) [@tanguy](https://discuss.elastic.co/u/tanguy)\
**Post date:** [June 6, 2016, 7:24am UTC](https://discuss.elastic.co/t/delete-by-query-stuck-after-installing-plugin/51837/3 "2016-06-06T07:24:03Z")

</div>

Hi,

The delete-by-query plugin produces some TRACE message in log that can help you.

If you want to enable them, update your `logging.yml file` with:

```
logger:
  ...
  action.deletebyquery: TRACE

```

-- Tanguy

---

<div class="post-metadata">

**Author:** ![arpan](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@arpan](https://discuss.elastic.co/u/arpan)\
**Post date:** [June 22, 2016, 6:53pm UTC](https://discuss.elastic.co/t/delete-by-query-stuck-after-installing-plugin/51837/4 "2016-06-22T18:53:02Z")

</div>

I've thought about that, but creating a kibana graph for trends over a week becomes difficult with that structure. Is there a way to get around that?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [June 22, 2016, 7:21pm UTC](https://discuss.elastic.co/t/delete-by-query-stuck-after-installing-plugin/51837/5 "2016-06-22T19:21:58Z")

</div>

> [@arpan](#):
>
> Is there a way to get around that?

I think the usual way to group these is to use an alias that points to all of the indexes. I'm not sure if that is the right thing for Kibana but I _think_ it is.

---

<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, 10:41pm UTC](https://discuss.elastic.co/t/delete-by-query-stuck-after-installing-plugin/51837/6 "2017-07-05T22:41:20Z")

</div>


