# Nested type is removed from the new index while reindexing

**URL:** <https://discuss.elastic.co/t/nested-type-is-removed-from-the-new-index-while-reindexing/333876>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [May 19, 2023, 3:06pm UTC](https://discuss.elastic.co/t/nested-type-is-removed-from-the-new-index-while-reindexing/333876 "2023-05-19T15:06:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maitri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maitri/32/123992_2.png) [@Maitri](https://discuss.elastic.co/u/Maitri)\
**Post date:** [May 19, 2023, 3:06pm UTC](https://discuss.elastic.co/t/nested-type-is-removed-from-the-new-index-while-reindexing/333876/1 "2023-05-19T15:06:26Z")

</div>

I have an index which a property with nested type. I am reindexing the index into new index. But, in the destination index every mapping are same except the property which was having nested type in the source index. nested type is removed from the destination index mappings. What is the reason of this? Though the values are nested. But since the type is removed, I am getting 400 error when try to read that property.

---

<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:** [May 19, 2023, 3:10pm UTC](https://discuss.elastic.co/t/nested-type-is-removed-from-the-new-index-while-reindexing/333876/2 "2023-05-19T15:10:54Z")

</div>

Did you set an indexing template that matches the new index? Reindex does not carry over mappings so a new index is created with default mappings if no template is provided.

---

<div class="post-metadata">

**Author:** ![Maitri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maitri/32/123992_2.png) [@Maitri](https://discuss.elastic.co/u/Maitri)\
**Post date:** [May 19, 2023, 3:52pm UTC](https://discuss.elastic.co/t/nested-type-is-removed-from-the-new-index-while-reindexing/333876/3 "2023-05-19T15:52:02Z")

</div>

Reindexing creates replica of the source index so I haven't created indexing template. But, all other property mappings of the source index are carried over. I am facing issue with just nested type. Wondering why only it was not copied over?

---

<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:** [May 19, 2023, 4:11pm UTC](https://discuss.elastic.co/t/nested-type-is-removed-from-the-new-index-while-reindexing/333876/4 "2023-05-19T16:11:30Z")

</div>

Reindexing does not copy mappings over, so I would default mappings to be applied to all fields. Nested properties are not identified and mapped as such when default mappings are used.

---

<div class="post-metadata">

**Author:** ![Maitri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maitri/32/123992_2.png) [@Maitri](https://discuss.elastic.co/u/Maitri)\
**Post date:** [May 19, 2023, 4:14pm UTC](https://discuss.elastic.co/t/nested-type-is-removed-from-the-new-index-while-reindexing/333876/5 "2023-05-19T16:14:15Z")

</div>

I see, thanks!

---

<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:** [June 16, 2023, 4:14pm UTC](https://discuss.elastic.co/t/nested-type-is-removed-from-the-new-index-while-reindexing/333876/6 "2023-06-16T16:14:30Z")

</div>

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