# How to make a template for a document which has too many fields?

**URL:** <https://discuss.elastic.co/t/how-to-make-a-template-for-a-document-which-has-too-many-fields/158822>\
**Category:** Elasticsearch\
**Created:** [November 29, 2018, 8:50pm UTC](https://discuss.elastic.co/t/how-to-make-a-template-for-a-document-which-has-too-many-fields/158822 "2018-11-29T20:50:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kazu1049jp](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@kazu1049jp](https://discuss.elastic.co/u/kazu1049jp)\
**Post date:** [November 29, 2018, 8:50pm UTC](https://discuss.elastic.co/t/how-to-make-a-template-for-a-document-which-has-too-many-fields/158822/1 "2018-11-29T20:50:11Z")

</div>

Hello.  
I want to make an index template for a document which has over 1000 fileds.  
But, I can't understand how to set a valid type for each field because making such template is too terrible...  
Can I make an index template which has a vague filed name?  
For example, the field name is "\*-date".  
In this case, I want to set the type, "timedate" for the field.

Best,  
kazu1049jp

---

<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:** [November 29, 2018, 9:46pm UTC](https://discuss.elastic.co/t/how-to-make-a-template-for-a-document-which-has-too-many-fields/158822/2 "2018-11-29T21:46:53Z")

</div>

You could try something like [https://www.elastic.co/guide/en/elasticsearch/reference/6.5/dynamic-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/dynamic-templates.html)

But it'll likely never be 100% perfect due to the size of the index you're dealing with.

---

<div class="post-metadata">

**Author:** ![kazu1049jp](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@kazu1049jp](https://discuss.elastic.co/u/kazu1049jp)\
**Post date:** [December 1, 2018, 8:09am UTC](https://discuss.elastic.co/t/how-to-make-a-template-for-a-document-which-has-too-many-fields/158822/3 "2018-12-01T08:09:56Z")

</div>

Thank you for your reply!  
I understantd using dynamic template mapping is better.

---

<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:** [December 29, 2018, 8:15am UTC](https://discuss.elastic.co/t/how-to-make-a-template-for-a-document-which-has-too-many-fields/158822/4 "2018-12-29T08:15:53Z")

</div>

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