# How to delete type of index using java api?

**URL:** <https://discuss.elastic.co/t/how-to-delete-type-of-index-using-java-api/45691>\
**Category:** Elasticsearch\
**Created:** [March 29, 2016, 1:42pm UTC](https://discuss.elastic.co/t/how-to-delete-type-of-index-using-java-api/45691 "2016-03-29T13:42:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajnikant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajnikant/32/6490_2.png) [@Rajnikant](https://discuss.elastic.co/u/Rajnikant)\
**Post date:** [March 29, 2016, 1:42pm UTC](https://discuss.elastic.co/t/how-to-delete-type-of-index-using-java-api/45691/1 "2016-03-29T13:42:41Z")

</div>

i have many types in one index and i want to delete one type from the index.

---

<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 29, 2016, 3:31pm UTC](https://discuss.elastic.co/t/how-to-delete-type-of-index-using-java-api/45691/2 "2016-03-29T15:31:26Z")

</div>

You have to delete all docs. Look at delete by query plugin.

That being said it won't remove the existing mapping.

Often, you'd better reindex in a new clean index.

---

<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, 9:59pm UTC](https://discuss.elastic.co/t/how-to-delete-type-of-index-using-java-api/45691/4 "2017-07-05T21:59:45Z")

</div>


