# How do I delete a single type, rather than a whole index?

**URL:** <https://discuss.elastic.co/t/how-do-i-delete-a-single-type-rather-than-a-whole-index/43315>\
**Category:** Elasticsearch\
**Created:** [March 2, 2016, 11:17pm UTC](https://discuss.elastic.co/t/how-do-i-delete-a-single-type-rather-than-a-whole-index/43315 "2016-03-02T23:17:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Randall](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@Randall](https://discuss.elastic.co/u/Randall)\
**Post date:** [March 2, 2016, 11:17pm UTC](https://discuss.elastic.co/t/how-do-i-delete-a-single-type-rather-than-a-whole-index/43315/1 "2016-03-02T23:17:53Z")

</div>

Hi.

The Definitive Guide explains how you can easily delete an entire index (DELETE /my\_index) but not a single type.

I assumed DELETE /my\_index/my\_type would work, but it doesn't.

I can delete each document individually (DELETE /my\_index/my\_type/my\_id) but that's a pain and very inefficient.

I'm in pre-production and I want to delete a particular type, rather than the whole index, so that I can set up the mappings correctly.

Thanks and kind regards  
Randall

---

<div class="post-metadata">

**Author:** ![cstrzadala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cstrzadala/32/8211_2.png) [@cstrzadala](https://discuss.elastic.co/u/cstrzadala)\
**Post date:** [March 2, 2016, 11:45pm UTC](https://discuss.elastic.co/t/how-do-i-delete-a-single-type-rather-than-a-whole-index/43315/2 "2016-03-02T23:45:19Z")

</div>

Hi Randall,

I've moved the post to the Elasticsearch channel as this is related to Elasticsearch core product rather than Elastic Cloud.

You might want to take a look at [https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-delete-mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-delete-mapping.html) or [https://www.elastic.co/guide/en/elasticsearch/reference/2.2/indices-delete-mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/2.2/indices-delete-mapping.html) depending on the version of Elasticsearch you are running.

Christian

---

<div class="post-metadata">

**Author:** ![Randall](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@Randall](https://discuss.elastic.co/u/Randall)\
**Post date:** [March 3, 2016, 12:01am UTC](https://discuss.elastic.co/t/how-do-i-delete-a-single-type-rather-than-a-whole-index/43315/3 "2016-03-03T00:01:39Z")

</div>

Hi Christian

I'm using Elastic Cloud and I've already searched the Elasticsearch channel, without success. The most relevant post I found there said the solution was to run some sort of delete query, but it was first necessary to download and install some additional software. That's obviously not an option for me given I'm using Elastic Cloud. I tried running the suggested delete query using my Kopf dashboard in the hope that the relevant software was already available on Elastic Cloud, also without success.

Surely if I can delete an entire index and a single document, there's a simple way to bulk delete all documents of a particular type!

Thanks and kind regards  
Randall

---

<div class="post-metadata">

**Author:** ![cstrzadala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cstrzadala/32/8211_2.png) [@cstrzadala](https://discuss.elastic.co/u/cstrzadala)\
**Post date:** [March 3, 2016, 12:28am UTC](https://discuss.elastic.co/t/how-do-i-delete-a-single-type-rather-than-a-whole-index/43315/4 "2016-03-03T00:28:39Z")

</div>

Hi Randall,

You have the option of using the `delete-by-query` plugin from within the Elastic Cloud console.

For more in-depth advice to help you with your elasticsearch usage in Elastic Cloud, take a look at our [Cloud Premium offerings](https://www.elastic.co/cloud/features) that offer SLA-based support. Get started with [Cloud Premium today by contacting Elastic.](https://www.elastic.co/contact).

## Regards, Christian

Learn More from the Cloud Team:

- [https://www.elastic.co/blog/found-sizing-elasticsearch](https://www.elastic.co/blog/found-sizing-elasticsearch)
- [https://www.elastic.co/blog/found-beginner-troubleshooting](https://www.elastic.co/blog/found-beginner-troubleshooting)
- [https://www.elastic.co/blog/found-optimizing-elasticsearch-searches](https://www.elastic.co/blog/found-optimizing-elasticsearch-searches)
- [https://www.elastic.co/blog/found-crash-elasticsearch](https://www.elastic.co/blog/found-crash-elasticsearch)
- [https://www.elastic.co/blog/found-understanding-memory-pressure-indicator](https://www.elastic.co/blog/found-understanding-memory-pressure-indicator)
- [https://www.elastic.co/blog/found-elasticsearch-in-production](https://www.elastic.co/blog/found-elasticsearch-in-production)

---

<div class="post-metadata">

**Author:** ![Randall](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@Randall](https://discuss.elastic.co/u/Randall)\
**Post date:** [March 3, 2016, 1:54am UTC](https://discuss.elastic.co/t/how-do-i-delete-a-single-type-rather-than-a-whole-index/43315/5 "2016-03-03T01:54:58Z")

</div>

Hi Christian

It seems that plugins are only available to Cloud Premium customers.

Given that it is possible to delete an index, not being able to delete a type without a plugin seems to be a rather glaring omission in this product.

Providing a solution, but only making it available to premium customers for an additional fee is rather disappointing because it forces me to pay for support that I don't need.

So now I have to delete the whole index, including every type, and replace everything. And to avoid this happening again I will have to set up a separate index for each type, which is not ideal.

A better solution would of course be for Elastic Cloud to either include this particular plugin as standard or expand the existing delete capability to include specified types!

Thanks and kind regards  
Randall

---

<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:11pm UTC](https://discuss.elastic.co/t/how-do-i-delete-a-single-type-rather-than-a-whole-index/43315/6 "2017-07-05T23:11:51Z")

</div>


