# How to delete and what to use

**URL:** <https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509>\
**Category:** Elasticsearch\
**Created:** [February 11, 2016, 4:08pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509 "2016-02-11T16:08:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mc1392](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@mc1392](https://discuss.elastic.co/u/mc1392)\
**Post date:** [February 11, 2016, 4:08pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509/1 "2016-02-11T16:08:24Z")

</div>

Elasticsearch seems to be moving really quickly with changes.

I am trying to figure out 1 way of deleted data, not multiple ways.

I just installed the delete-by-query plugin. I have a few questions:

1. How do I actually use the plugin? is it in the elasticsearch/bin folder? what is the command? I already installed it but I dont see it anywhere on my ubuntu?

2. How do I delete by time range using the timestamp?

3. Should I be using sensa or one of the plugins to delete data?

---

<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:** [February 11, 2016, 4:56pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509/2 "2016-02-11T16:56:44Z")

</div>

Are you looking for the documentation? It's there: [https://www.elastic.co/guide/en/elasticsearch/plugins/2.2/plugins-delete-by-query.html](https://www.elastic.co/guide/en/elasticsearch/plugins/2.2/plugins-delete-by-query.html)

---

<div class="post-metadata">

**Author:** ![mc1392](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@mc1392](https://discuss.elastic.co/u/mc1392)\
**Post date:** [February 11, 2016, 5:10pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509/3 "2016-02-11T17:10:13Z")

</div>

You call that documentation?  
How do I run it?

---

<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:** [February 11, 2016, 5:49pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509/4 "2016-02-11T17:49:35Z")

</div>

What you did not understand in doc ?

It seems pretty clear to me.

May be you did not notice the link "using delete by query"? [https://www.elastic.co/guide/en/elasticsearch/plugins/2.2/delete-by-query-usage.html](https://www.elastic.co/guide/en/elasticsearch/plugins/2.2/delete-by-query-usage.html)

---

<div class="post-metadata">

**Author:** ![mc1392](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@mc1392](https://discuss.elastic.co/u/mc1392)\
**Post date:** [February 11, 2016, 5:52pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509/5 "2016-02-11T17:52:15Z")

</div>

How am I supposed to access the executable?

Here is what I get:

```
ubuntu@ip-10-0-0-230:~$ DELETE /member_type_history/Member Type/_query?q=user:kimchy
DELETE: command not found

```

I dont get how to run this against my ES?

---

<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:** [February 11, 2016, 6:06pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509/6 "2016-02-11T18:06:43Z")

</div>

It's a SENSE format. You can copy and paste it to sense.

From the command line, use curl.

```auto
curl -XDELETE localhost:9200/member_type_history/Member Type/_query?q=user:kimchy

```

---

<div class="post-metadata">

**Author:** ![mc1392](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@mc1392](https://discuss.elastic.co/u/mc1392)\
**Post date:** [February 11, 2016, 8:59pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509/7 "2016-02-11T20:59:32Z")

</div>

Ok, could you help me with 1 more thing?

How do I use a timestamp range using that syntax?

---

<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:** [February 11, 2016, 9:23pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509/8 "2016-02-11T21:23:31Z")

</div>

You need to use the QueryDSL

---

<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:16pm UTC](https://discuss.elastic.co/t/how-to-delete-and-what-to-use/41509/9 "2017-07-05T23:16:59Z")

</div>


