# Nested object within nested object annotation question

**URL:** <https://discuss.elastic.co/t/nested-object-within-nested-object-annotation-question/110167>\
**Category:** Elasticsearch\
**Created:** [December 4, 2017, 3:37pm UTC](https://discuss.elastic.co/t/nested-object-within-nested-object-annotation-question/110167 "2017-12-04T15:37:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johntadd](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@johntadd](https://discuss.elastic.co/u/johntadd)\
**Post date:** [December 4, 2017, 3:37pm UTC](https://discuss.elastic.co/t/nested-object-within-nested-object-annotation-question/110167/1 "2017-12-04T15:37:21Z")

</div>

Following

[https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-objects.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-objects.html)  
[https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-mapping.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-mapping.html)

I create an index with nested object enabled.

Now I have a new question. When having a complicated doc whose nested object actually contain other arbitrary nested objects (that in turns may contain other arbitrary nested objects, and so on.). For instance

```
"level1": [
    {
         "level2": [
             {
                 "level3": [
                     { 
                          ...
                     },
                     ...  
                 ]
             },
             ...
         ]
    },
    ...      
]

```

In such case, do I need to specify `"type": "nested"` at each field at all level (For example, level1 annotated with `"type":"nested"`, so do level2, level3, and so on)? Or the mapping only need to be specified with `"type": "nested"` at the level1 field?

Thank you.

---

<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:** [January 1, 2018, 3:37pm UTC](https://discuss.elastic.co/t/nested-object-within-nested-object-annotation-question/110167/2 "2018-01-01T15:37:26Z")

</div>

Closed on January 1, 2018, 3:37pm UTC

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