# With the removal of doc types, must I reindex all the indices that use a named type?

**URL:** <https://discuss.elastic.co/t/with-the-removal-of-doc-types-must-i-reindex-all-the-indices-that-use-a-named-type/237947>\
**Category:** Elasticsearch\
**Created:** [June 21, 2020, 6:38am UTC](https://discuss.elastic.co/t/with-the-removal-of-doc-types-must-i-reindex-all-the-indices-that-use-a-named-type/237947 "2020-06-21T06:38:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![smlbiobot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smlbiobot/32/29622_2.png) [@smlbiobot](https://discuss.elastic.co/u/smlbiobot)\
**Post date:** [June 21, 2020, 6:38am UTC](https://discuss.elastic.co/t/with-the-removal-of-doc-types-must-i-reindex-all-the-indices-that-use-a-named-type/237947/1 "2020-06-21T06:38:58Z")

</div>

I am getting conflicting instructions regarding the removal of doc types. If my indices only having one doc type (but not named `_doc`), do I have to reindex all the indices before I upgrade, or will it upgrade and simply ignore the type?

I was getting some depreciation warning before, but if I look at the 7.0 Upgrade Assistant right now, it is saying that my cluster has no issue. I haven’t upgraded to 7.x mostly because of this so I want to make sure that I can do this before going further. If I had to reindex all the indices from a named doc type to`_doc`, it is a rather involved process so I would like to avoid that unless absolutely necessary.

Please advice. Thanks!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 21, 2020, 7:45am UTC](https://discuss.elastic.co/t/with-the-removal-of-doc-types-must-i-reindex-all-the-indices-that-use-a-named-type/237947/2 "2020-06-21T07:45:41Z")

</div>

I believe indices created in Elasticsearch 6.x with a different type name will continue to work, but if you are creating new indices, e.g. time-based ones, these will need to have the standard type going forward. You may therefore need to update index templates and ingest config.

---

<div class="post-metadata">

**Author:** ![smlbiobot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smlbiobot/32/29622_2.png) [@smlbiobot](https://discuss.elastic.co/u/smlbiobot)\
**Post date:** [June 21, 2020, 8:03am UTC](https://discuss.elastic.co/t/with-the-removal-of-doc-types-must-i-reindex-all-the-indices-that-use-a-named-type/237947/3 "2020-06-21T08:03:02Z")

</div>

What happens if:

- the index will continue to get new documents? Will that become an issue in 7.x and 8.x when the type is completely removed? What I have tried to do is indexing new documents with `_doc` but then ES complains that I have two doc types in the index.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 21, 2020, 9:22am UTC](https://discuss.elastic.co/t/with-the-removal-of-doc-types-must-i-reindex-all-the-indices-that-use-a-named-type/237947/4 "2020-06-21T09:22:47Z")

</div>

Indices created in version 6.x will need to be reindexed and have the type adjusted before moving to 8.x, but it should work in 7.x. If you are using time-based indices it may make sense to add the major version number to the index name, e.g. `test-7-*` for indices created under version 7.x. This allows you to stop writing to indices (assumes you are not updating) created under older versions.

---

<div class="post-metadata">

**Author:** ![smlbiobot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smlbiobot/32/29622_2.png) [@smlbiobot](https://discuss.elastic.co/u/smlbiobot)\
**Post date:** [June 21, 2020, 10:07am UTC](https://discuss.elastic.co/t/with-the-removal-of-doc-types-must-i-reindex-all-the-indices-that-use-a-named-type/237947/5 "2020-06-21T10:07:23Z")

</div>

I see. In other words, I will have to do it regardless if I wanted to move to 8.x. Thanks for your reply. This is extremely helpful!

---

<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 19, 2020, 10:07am UTC](https://discuss.elastic.co/t/with-the-removal-of-doc-types-must-i-reindex-all-the-indices-that-use-a-named-type/237947/6 "2020-07-19T10:07:42Z")

</div>

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