# How can we add dynamic templates in existing elastic index

**URL:** <https://discuss.elastic.co/t/how-can-we-add-dynamic-templates-in-existing-elastic-index/264282>\
**Category:** Elasticsearch\
**Created:** [February 15, 2021, 7:21am UTC](https://discuss.elastic.co/t/how-can-we-add-dynamic-templates-in-existing-elastic-index/264282 "2021-02-15T07:21:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![prakhara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prakhara/32/45904_2.png) [@prakhara](https://discuss.elastic.co/u/prakhara)\
**Post date:** [February 15, 2021, 7:21am UTC](https://discuss.elastic.co/t/how-can-we-add-dynamic-templates-in-existing-elastic-index/264282/1 "2021-02-15T07:21:28Z")

</div>

I have a need to add more dynamic templates in my existing index mappings,  
how can I do that  
Tried doing below, but it didn't worked  
PUT {$indexname}\_mappings  
{  
"mappings" : {  
"dynamic\_templates" : [  
{  
"strings" : {  
"match" : "\*\_ss",  
"match\_mapping\_type" : "string",  
"mapping" : {  
"fields" : {  
"text" : {  
"store" : true,  
"type" : "text"  
}  
},  
"type" : "keyword"  
}  
}  
}  
]  
}  
}

---

<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:** [February 15, 2021, 10:42pm UTC](https://discuss.elastic.co/t/how-can-we-add-dynamic-templates-in-existing-elastic-index/264282/2 "2021-02-15T22:42:54Z")

</div>

> [@prakhara](#):
>
> Tried doing below, but it didn't worked

What didn't work exactly?

---

<div class="post-metadata">

**Author:** ![prakhara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prakhara/32/45904_2.png) [@prakhara](https://discuss.elastic.co/u/prakhara)\
**Post date:** [February 16, 2021, 6:23am UTC](https://discuss.elastic.co/t/how-can-we-add-dynamic-templates-in-existing-elastic-index/264282/3 "2021-02-16T06:23:06Z")

</div>

Hey Mark,

Actually I want to add more dynamic templates in the existing schema definition of an index.

---

<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:** [February 16, 2021, 9:21pm UTC](https://discuss.elastic.co/t/how-can-we-add-dynamic-templates-in-existing-elastic-index/264282/4 "2021-02-16T21:21:26Z")

</div>

Ok, but that doesn't describe what is not working.

---

<div class="post-metadata">

**Author:** ![prakhara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prakhara/32/45904_2.png) [@prakhara](https://discuss.elastic.co/u/prakhara)\
**Post date:** [February 19, 2021, 6:36am UTC](https://discuss.elastic.co/t/how-can-we-add-dynamic-templates-in-existing-elastic-index/264282/5 "2021-02-19T06:36:39Z")

</div>

I didn't said it is not working,  
I want to know how can I add more dynamic templates in the existing schema definition of an index.

---

<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:** [February 21, 2021, 9:16pm UTC](https://discuss.elastic.co/t/how-can-we-add-dynamic-templates-in-existing-elastic-index/264282/6 "2021-02-21T21:16:22Z")

</div>

> [@prakhara](#):
>
> Tried doing below, but it didn't worked

Yeah, you did, which is why I asked 🙂

So if you tried to apply this and it's not doing what you want, what is it doing? What response are you getting from Elasticsearch? What do you see in the mapping?

---

<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:** [March 21, 2021, 9:16pm UTC](https://discuss.elastic.co/t/how-can-we-add-dynamic-templates-in-existing-elastic-index/264282/7 "2021-03-21T21:16:37Z")

</div>

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