# Straight forward way to delete all doc

**URL:** <https://discuss.elastic.co/t/straight-forward-way-to-delete-all-doc/96002>\
**Category:** Elasticsearch\
**Created:** [August 6, 2017, 3:38am UTC](https://discuss.elastic.co/t/straight-forward-way-to-delete-all-doc/96002 "2017-08-06T03:38:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nithin\_Devang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nithin_devang/32/25023_2.png) [@Nithin\_Devang](https://discuss.elastic.co/u/Nithin_Devang)\
**Post date:** [August 6, 2017, 3:38am UTC](https://discuss.elastic.co/t/straight-forward-way-to-delete-all-doc/96002/1 "2017-08-06T03:38:16Z")

</div>

Is there a straight forward way to delete all docs based on type. delete by query do not seem to be working.

---

<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:** [August 6, 2017, 11:22am UTC](https://discuss.elastic.co/t/straight-forward-way-to-delete-all-doc/96002/2 "2017-08-06T11:22:33Z")

</div>

Delete by query should work.

But it's often better to reindex.

Note that in 6.0 you will be allowed to have only one type per index. So removing a type will be the same as removing an index which is the most efficient.

---

<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:** [September 8, 2017, 3:48am UTC](https://discuss.elastic.co/t/straight-forward-way-to-delete-all-doc/96002/4 "2017-09-08T03:48:56Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
