# Template mappings vs config mappings

**URL:** <https://discuss.elastic.co/t/template-mappings-vs-config-mappings/4508>\
**Category:** Elasticsearch\
**Created:** [May 31, 2011, 7:35pm UTC](https://discuss.elastic.co/t/template-mappings-vs-config-mappings/4508 "2011-05-31T19:35:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![colinsurprenant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colinsurprenant/32/14776_2.png) [@colinsurprenant](https://discuss.elastic.co/u/colinsurprenant)\
**Post date:** [May 31, 2011, 7:35pm UTC](https://discuss.elastic.co/t/template-mappings-vs-config-mappings/4508/1 "2011-05-31T19:35:04Z")

</div>

Hi,

If I have a default mapping for type "mytype" in  
config/mappings/\_default/mytype.json and I create a template with

{  
"template" : "\*",  
"settings" : { ... },  
"mappings" : {"mytype": { ... }}  
}

whenever a new index is created, it seems that both mappings are  
merged. Is this the intended behaviour? Is there a way to force the  
template mapping over the config mapping without stopping the cluster?

Thanks,  
Colin

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 31, 2011, 11:22pm UTC](https://discuss.elastic.co/t/template-mappings-vs-config-mappings/4508/2 "2011-05-31T23:22:51Z")

</div>

Yes, this is the intended behavior. There is no option to force one over the other aside from not using one of them.

On Tuesday, May 31, 2011 at 10:35 PM, Colin Surprenant wrote:

> Hi,
> 
> If I have a default mapping for type "mytype" in  
> config/mappings/\_default/mytype.json and I create a template with
> 
> {  
> "template" : "\*",  
> "settings" : { ... },  
> "mappings" : {"mytype": { ... }}  
> }
> 
> whenever a new index is created, it seems that both mappings are  
> merged. Is this the intended behaviour? Is there a way to force the  
> template mapping over the config mapping without stopping the cluster?
> 
> Thanks,  
> Colin

---

<div class="post-metadata">

**Author:** ![colinsurprenant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colinsurprenant/32/14776_2.png) [@colinsurprenant](https://discuss.elastic.co/u/colinsurprenant)\
**Post date:** [June 1, 2011, 1:59pm UTC](https://discuss.elastic.co/t/template-mappings-vs-config-mappings/4508/3 "2011-06-01T13:59:14Z")

</div>

Ok, thanks.

Is there a way to get rid of the config mappings without restarting ES?

Colin

On Tue, May 31, 2011 at 7:22 PM, Shay Banon  
[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) wrote:

> Yes, this is the intended behavior. There is no option to force one over the  
> other aside from not using one of them.
> 
> On Tuesday, May 31, 2011 at 10:35 PM, Colin Surprenant wrote:
> 
> Hi,
> 
> If I have a default mapping for type "mytype" in  
> config/mappings/\_default/mytype.json and I create a template with
> 
> {  
> "template" : "\*",  
> "settings" : { ... },  
> "mappings" : {"mytype": { ... }}  
> }
> 
> whenever a new index is created, it seems that both mappings are  
> merged. Is this the intended behaviour? Is there a way to force the  
> template mapping over the config mapping without stopping the cluster?
> 
> Thanks,  
> Colin

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [June 1, 2011, 2:25pm UTC](https://discuss.elastic.co/t/template-mappings-vs-config-mappings/4508/4 "2011-06-01T14:25:52Z")

</div>

You can just delete them, they are read on demand when the index is created.

On Wednesday, June 1, 2011 at 4:59 PM, Colin Surprenant wrote:

> Ok, thanks.
> 
> Is there a way to get rid of the config mappings without restarting ES?
> 
> Colin
> 
> On Tue, May 31, 2011 at 7:22 PM, Shay Banon  
> \<[shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com) ([mailto:shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com))\> wrote:
> 
> > Yes, this is the intended behavior. There is no option to force one over the  
> > other aside from not using one of them.
> > 
> > On Tuesday, May 31, 2011 at 10:35 PM, Colin Surprenant wrote:
> > 
> > Hi,
> > 
> > If I have a default mapping for type "mytype" in  
> > config/mappings/\_default/mytype.json and I create a template with
> > 
> > {  
> > "template" : "\*",  
> > "settings" : { ... },  
> > "mappings" : {"mytype": { ... }}  
> > }
> > 
> > whenever a new index is created, it seems that both mappings are  
> > merged. Is this the intended behaviour? Is there a way to force the  
> > template mapping over the config mapping without stopping the cluster?
> > 
> > Thanks,  
> > Colin

---

<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:** [July 6, 2017, 4:05am UTC](https://discuss.elastic.co/t/template-mappings-vs-config-mappings/4508/5 "2017-07-06T04:05:01Z")

</div>


