# How to delete type?thanks

**URL:** <https://discuss.elastic.co/t/how-to-delete-type-thanks/65163>\
**Category:** Elasticsearch\
**Created:** [November 7, 2016, 5:36am UTC](https://discuss.elastic.co/t/how-to-delete-type-thanks/65163 "2016-11-07T05:36:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![23233](https://avatars.discourse-cdn.com/v4/letter/2/ecc23a/32.png) [@23233](https://discuss.elastic.co/u/23233)\
**Post date:** [November 7, 2016, 5:36am UTC](https://discuss.elastic.co/t/how-to-delete-type-thanks/65163/1 "2016-11-07T05:36:51Z")

</div>

# 

**i don't know es5.0 how detele type**  
**please help me**

**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:** [November 7, 2016, 5:38am UTC](https://discuss.elastic.co/t/how-to-delete-type-thanks/65163/2 "2016-11-07T05:38:31Z")

</div>

You cannot, the closest you can get is [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete-by-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete-by-query.html)

---

<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:** [November 7, 2016, 6:53am UTC](https://discuss.elastic.co/t/how-to-delete-type-thanks/65163/3 "2016-11-07T06:53:15Z")

</div>

And sometimes when you don't have important data (well when you just start to play with elasticsearch) it's better to remove the full index.

---

<div class="post-metadata">

**Author:** ![23233](https://avatars.discourse-cdn.com/v4/letter/2/ecc23a/32.png) [@23233](https://discuss.elastic.co/u/23233)\
**Post date:** [November 7, 2016, 8:33am UTC](https://discuss.elastic.co/t/how-to-delete-type-thanks/65163/4 "2016-11-07T08:33:40Z")

</div>

# 

**first very thank you reply my quesition**

# 

**if i data not has important data,i will chose delete `index` ,but now is i in input multiple `type` but of one `type` fail i want delete this error `type` after re-input**

\*\*i want to try \_delete\_by\_query this is my code \*\*  
`curl -XPOST http://localhost:9200/myindex/wantDeleteType/_delete_by_query { "query": { "range": { "id":{"gte":1} } } }`

---

<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:** [November 7, 2016, 8:57am UTC](https://discuss.elastic.co/t/how-to-delete-type-thanks/65163/5 "2016-11-07T08:57:35Z")

</div>

If you want to delete a type because you want to change the mapping, this will not work.  
If you just want to reindex old data using the same mapping then you don't need to remove old data before that as long as you are using the same I'd.

If you explain a bit more what you are trying to solve here we can give you the best solution for it.

---

<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:** [December 5, 2016, 8:57am UTC](https://discuss.elastic.co/t/how-to-delete-type-thanks/65163/6 "2016-12-05T08:57:53Z")

</div>

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