# Nested become array object after re-indexing?

**URL:** <https://discuss.elastic.co/t/nested-become-array-object-after-re-indexing/130980>\
**Category:** Elasticsearch\
**Created:** [May 8, 2018, 10:36am UTC](https://discuss.elastic.co/t/nested-become-array-object-after-re-indexing/130980 "2018-05-08T10:36:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanwiii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yanwiii/32/30925_2.png) [@yanwiii](https://discuss.elastic.co/u/yanwiii)\
**Post date:** [May 8, 2018, 10:36am UTC](https://discuss.elastic.co/t/nested-become-array-object-after-re-indexing/130980/1 "2018-05-08T10:36:13Z")

</div>

my mappings:

```
{
    "mappings":{
        "test":{
            "properties":{
                "date":{
                    "type":"nested",
                    "properties":{....} 
                }
            }
        }
    }   
}

```

after i reindexing the index, the type of **date** become normal array object, it's not nested any more. Why ???

My re-index script:  
ES.reindex(  
{  
"source":{  
"index":"test"  
},  
"dest":{  
"index":"test-v1"  
},  
}  
)

---

<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 8, 2018, 10:06pm UTC](https://discuss.elastic.co/t/nested-become-array-object-after-re-indexing/130980/2 "2018-05-08T22:06:14Z")

</div>

How did you reindex it?

---

<div class="post-metadata">

**Author:** ![yanwiii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yanwiii/32/30925_2.png) [@yanwiii](https://discuss.elastic.co/u/yanwiii)\
**Post date:** [May 9, 2018, 2:04am UTC](https://discuss.elastic.co/t/nested-become-array-object-after-re-indexing/130980/3 "2018-05-09T02:04:15Z")

</div>

```
ES.reindex({
    "source":{
        "index":"test"
    },
    "dest":{
        "index":"test-v1"
   },
})
```

---

<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 9, 2018, 2:21am UTC](https://discuss.elastic.co/t/nested-become-array-object-after-re-indexing/130980/4 "2018-05-09T02:21:59Z")

</div>

So the `_reindex` API.

Did you apply the mapping to the new index before you ran the request? See [https://www.elastic.co/guide/en/elasticsearch/reference/6.2/docs-reindex.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/docs-reindex.html)

---

<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 6, 2018, 2:22am UTC](https://discuss.elastic.co/t/nested-become-array-object-after-re-indexing/130980/5 "2018-06-06T02:22:01Z")

</div>

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