# Delete all entries from a type

**URL:** <https://discuss.elastic.co/t/delete-all-entries-from-a-type/16642>\
**Category:** Elasticsearch\
**Created:** [March 27, 2014, 1:43pm UTC](https://discuss.elastic.co/t/delete-all-entries-from-a-type/16642 "2014-03-27T13:43:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruskie24](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bruskie24](https://discuss.elastic.co/u/bruskie24)\
**Post date:** [March 27, 2014, 1:43pm UTC](https://discuss.elastic.co/t/delete-all-entries-from-a-type/16642/1 "2014-03-27T13:43:32Z")

</div>

Is there a method of deleting all entries in a specific type in an Index without deleting the whole type and also preserving the mapping for that type? I want to clear out a type without having to reindex or remove the type. Is this possible? I've tried variations of match\_all and wildcard queries and haven't had any luck.

Right now I'm trying  
curl -XDELETE '[http://localhost:9200/index/type/\_query?q=\_id:\*](http://localhost:9200/index/type/_query?q=_id:*)', and it seems to return successful in the terminal window, but doesn't actually delete the entries in my type.

---

<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:** [March 27, 2014, 2:18pm UTC](https://discuss.elastic.co/t/delete-all-entries-from-a-type/16642/2 "2014-03-27T14:18:59Z")

</div>

May be this?

curl -XDELETE '[http://localhost:9200/index/type/\_query?q=\_type:type](http://localhost:9200/index/type/_query?q=_type:type)'

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 27 mars 2014 à 14:43, bruskie24 [jmassey@clearedgeit.com](mailto:jmassey@clearedgeit.com) a écrit :
> 
> Is there a method of deleting all entries in a specific type in an Index  
> without deleting the whole type and also preserving the mapping for that  
> type? I want to clear out a type without having to reindex or remove the  
> type. Is this possible? I've tried variations of match\_all and wildcard  
> queries and haven't had any luck.
> 
> Right now I'm trying  
> curl -XDELETE '[http://localhost:9200/index/type/\_query?q=\_id:](http://localhost:9200/index/type/_query?q=_id:)\*', and it  
> seems to return successful in the terminal window, but doesn't actually  
> delete the entries in my type.
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Delete-all-entries-from-a-type-tp4052902.html](http://elasticsearch-users.115913.n3.nabble.com/Delete-all-entries-from-a-type-tp4052902.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1395927812876-4052902.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1395927812876-4052902.post%40n3.nabble.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4768EB3A-2FD6-4D0D-877D-FE36D31E1B03%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/4768EB3A-2FD6-4D0D-877D-FE36D31E1B03%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![bruskie24](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bruskie24](https://discuss.elastic.co/u/bruskie24)\
**Post date:** [March 27, 2014, 2:28pm UTC](https://discuss.elastic.co/t/delete-all-entries-from-a-type/16642/3 "2014-03-27T14:28:38Z")

</div>

Yes, that worked, thanks!

---

<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 6, 2017, 1:40am UTC](https://discuss.elastic.co/t/delete-all-entries-from-a-type/16642/4 "2017-07-06T01:40:09Z")

</div>


