# Delete documents type after version 2.0

**URL:** <https://discuss.elastic.co/t/delete-documents-type-after-version-2-0/49826>\
**Category:** Elasticsearch\
**Created:** [May 11, 2016, 8:47pm UTC](https://discuss.elastic.co/t/delete-documents-type-after-version-2-0/49826 "2016-05-11T20:47:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuan0122](https://avatars.discourse-cdn.com/v4/letter/y/b9bd4f/32.png) [@yuan0122](https://discuss.elastic.co/u/yuan0122)\
**Post date:** [May 11, 2016, 8:47pm UTC](https://discuss.elastic.co/t/delete-documents-type-after-version-2-0/49826/1 "2016-05-11T20:47:21Z")

</div>

I am trying to find out if there is any good way to delete a type after version 2.0, since delete by type was deprecated after 2.0

I am using Hive Integration to insert documents into elasticsearch. if hive's map reduce job die halfway due to some reasons; and re-insert without clean up all documents would end up with a lot of duplicate documents. If I have millions of documents, it would take really a long time to delete by query using "match\_all". So I am just asking if there is a good way to efficiently delete a type. Thanks!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 12, 2016, 12:42am UTC](https://discuss.elastic.co/t/delete-documents-type-after-version-2-0/49826/2 "2016-05-12T00:42:29Z")

</div>

> [@yuan0122](#):
>
> So I am just asking if there is a good way to efficiently delete a type

No, there is no way to do this efficiently.  
You'd be better off putting things into their own indices.

---

<div class="post-metadata">

**Author:** ![yuan0122](https://avatars.discourse-cdn.com/v4/letter/y/b9bd4f/32.png) [@yuan0122](https://discuss.elastic.co/u/yuan0122)\
**Post date:** [May 12, 2016, 5:47pm UTC](https://discuss.elastic.co/t/delete-documents-type-after-version-2-0/49826/3 "2016-05-12T17:47:44Z")

</div>

Thanks for you reply.

This is exactly what I am going to do. I think I will put more information in their indices.

---

<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:52pm UTC](https://discuss.elastic.co/t/delete-documents-type-after-version-2-0/49826/4 "2017-07-05T22:52:01Z")

</div>


