# Can we create Dynamic fields in schema?

**URL:** <https://discuss.elastic.co/t/can-we-create-dynamic-fields-in-schema/163464>\
**Category:** Elasticsearch\
**Created:** [January 9, 2019, 7:35am UTC](https://discuss.elastic.co/t/can-we-create-dynamic-fields-in-schema/163464 "2019-01-09T07:35:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adityaPsl](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@adityaPsl](https://discuss.elastic.co/u/adityaPsl)\
**Post date:** [January 9, 2019, 7:35am UTC](https://discuss.elastic.co/t/can-we-create-dynamic-fields-in-schema/163464/1 "2019-01-09T07:35:07Z")

</div>

Hello Team,

Is it possible to create Dynamic fields in schema?  
Use case :if I am ingesting a document with 5 fields and all of them are typicallye double and have same properties.so instead of creating 5 different fields in schema can I create one field with some pattern and while ingesting if I follow that pattern on field, the field would get created with respective properties.

For example

"mappings" : {  
"\_doc" : {  
"properties" : {  
"\<field\_name\>" : { "type" : "text"  
}  
}  
}

Thanks in advance for your help.

Thank you,  
Aditya

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 9, 2019, 8:53am UTC](https://discuss.elastic.co/t/can-we-create-dynamic-fields-in-schema/163464/2 "2019-01-09T08:53:49Z")

</div>

You should take a look at [dynamic templates](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/dynamic-templates.html) as well as [index templates](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/indices-templates.html)

--Alex

---

<div class="post-metadata">

**Author:** ![adityaPsl](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@adityaPsl](https://discuss.elastic.co/u/adityaPsl)\
**Post date:** [January 9, 2019, 9:03am UTC](https://discuss.elastic.co/t/can-we-create-dynamic-fields-in-schema/163464/3 "2019-01-09T09:03:33Z")

</div>

Thank you very much Alex.

---

<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 6, 2019, 9:03am UTC](https://discuss.elastic.co/t/can-we-create-dynamic-fields-in-schema/163464/4 "2019-02-06T09:03:42Z")

</div>

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