# Create nested type during index creation (Dynamic)

**URL:** <https://discuss.elastic.co/t/create-nested-type-during-index-creation-dynamic/165134>\
**Category:** Elasticsearch\
**Created:** [January 22, 2019, 12:19am UTC](https://discuss.elastic.co/t/create-nested-type-during-index-creation-dynamic/165134 "2019-01-22T00:19:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramchjob](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ramchjob/32/31480_2.png) [@ramchjob](https://discuss.elastic.co/u/ramchjob)\
**Post date:** [January 22, 2019, 12:19am UTC](https://discuss.elastic.co/t/create-nested-type-during-index-creation-dynamic/165134/1 "2019-01-22T00:19:56Z")

</div>

Hey Gurus, i am sure most of the ppl might have came across this.

I am looking to have a nested type defined during index creation (Dynamic mapping). below are the options have explored.

Option 1:

1. Push a document to index
2. Get the mappings created from step1
3. Modify the mappings with nested type.
4. Update the mappings.

Option 2:  
Dynamic templates.

Please let me know if there a way to create nested types during initial (dynamic) index creation.

Thanks in advance.

---

<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:** [February 19, 2019, 12:20am UTC](https://discuss.elastic.co/t/create-nested-type-during-index-creation-dynamic/165134/2 "2019-02-19T00:20:03Z")

</div>

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