# Dynamic template behaviour

**URL:** <https://discuss.elastic.co/t/dynamic-template-behaviour/4875>\
**Category:** Elasticsearch\
**Created:** [July 15, 2011, 9:41pm UTC](https://discuss.elastic.co/t/dynamic-template-behaviour/4875 "2011-07-15T21:41:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [July 15, 2011, 9:41pm UTC](https://discuss.elastic.co/t/dynamic-template-behaviour/4875/1 "2011-07-15T21:41:36Z")

</div>

Is the following behaviour expected?

I have:

{ "article" : {  
"dynamic\_templates" : [{  
"template\_1" : {  
"match" : "\*",  
"match\_mapping\_type" : "string",  
"mapping" : { "type" : "string", "index" :  
"not\_analyzed", "omit\_norms" : "yes" }  
}}],  
"\_all" : {"enabled" : false},  
"properties" : {  
"title" : { "type" : "string", "analyzer" :  
"index\_analyzer"}  
}}}

But omit\_norms does NOT apply to explicit fields under "properties".  
So I need to specifiy it again to make it working:

...  
"properties" : {  
"title" : { "type" : "string", "analyzer" :  
"index\_analyzer", "omit\_norms" : "yes" }  
}  
...

I would expect that my template 'initializes' the default settings for  
the matching fields and I can overwrite those defaults under  
properties ...

Regards,  
Peter.

---

<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:** [July 15, 2011, 10:05pm UTC](https://discuss.elastic.co/t/dynamic-template-behaviour/4875/2 "2011-07-15T22:05:50Z")

</div>

Try "omit\_norms": true.

On Saturday, July 16, 2011 at 12:41 AM, Karussell wrote:

> Is the following behaviour expected?
> 
> I have:
> 
> { "article" : {  
> "dynamic\_templates" : [{  
> "template\_1" : {  
> ""match" : "\*",  
> "match\_mapping\_type" : "string",  
> "mapping" : { "type" : "string", "index" :  
> "not\_analyzed", "omit\_norms" : "yes" }  
> }}],  
> "\_all" : {"enabled" : false},  
> "properties" : {  
> "title" : { "type" : "string", "analyzer" :  
> "index\_analyzer"}  
> }}}
> 
> But omit\_norms does NOT apply to explicit fields under "properties".  
> So I need to specifiy it again to make it working:
> 
> ...  
> "properties" : {  
> "title" : { "type" : "string", "analyzer" :  
> "index\_analyzer", "omit\_norms" : "yes" }  
> }  
> ...
> 
> I would expect that my template 'initializes' the default settings for  
> the matching fields and I can overwrite those defaults under  
> properties ...
> 
> Regards,  
> Peter.

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [July 16, 2011, 5:47pm UTC](https://discuss.elastic.co/t/dynamic-template-behaviour/4875/3 "2011-07-16T17:47:05Z")

</div>

Uhm, thanks 🙂 !

this wrong config should fail louder 😉

On 16 Jul., 00:05, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Try "omit\_norms": true.
> 
> On Saturday, July 16, 2011 at 12:41 AM, Karussell wrote:
> 
> > Is the following behaviour expected?
> 
> > I have:
> 
> > { "article" : {  
> > "dynamic\_templates" : [{  
> > "template\_1" : {  
> > ""match" : "\*",  
> > "match\_mapping\_type" : "string",  
> > "mapping" : { "type" : "string", "index" :  
> > "not\_analyzed", "omit\_norms" : "yes" }  
> > }}],  
> > "\_all" : {"enabled" : false},  
> > "properties" : {  
> > "title" : { "type" : "string", "analyzer" :  
> > "index\_analyzer"}  
> > }}}
> 
> > But omit\_norms does NOT apply to explicit fields under "properties".  
> > So I need to specifiy it again to make it working:
> 
> > ...  
> > "properties" : {  
> > "title" : { "type" : "string", "analyzer" :  
> > "index\_analyzer", "omit\_norms" : "yes" }  
> > }  
> > ...
> 
> > I would expect that my template 'initializes' the default settings for  
> > the matching fields and I can overwrite those defaults under  
> > properties ...
> 
> > Regards,  
> > Peter.

---

<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:** [July 17, 2011, 6:32pm UTC](https://discuss.elastic.co/t/dynamic-template-behaviour/4875/4 "2011-07-17T18:32:32Z")

</div>

Boolean values also automatically handle string values, and only parse for  
false state ("false", "0", "off"), everything else is true....

On Sat, Jul 16, 2011 at 8:47 PM, Karussell [tableyourtime@googlemail.com](mailto:tableyourtime@googlemail.com)wrote:

> Uhm, thanks 🙂 !
> 
> this wrong config should fail louder 😉
> 
> On 16 Jul., 00:05, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Try "omit\_norms": true.
> > 
> > On Saturday, July 16, 2011 at 12:41 AM, Karussell wrote:
> > 
> > > Is the following behaviour expected?
> > 
> > > I have:
> > 
> > > { "article" : {  
> > > "dynamic\_templates" : [{  
> > > "template\_1" : {  
> > > ""match" : "\*",  
> > > "match\_mapping\_type" : "string",  
> > > "mapping" : { "type" : "string", "index" :  
> > > "not\_analyzed", "omit\_norms" : "yes" }  
> > > }}],  
> > > "\_all" : {"enabled" : false},  
> > > "properties" : {  
> > > "title" : { "type" : "string", "analyzer" :  
> > > "index\_analyzer"}  
> > > }}}
> > 
> > > But omit\_norms does NOT apply to explicit fields under "properties".  
> > > So I need to specifiy it again to make it working:
> > 
> > > ...  
> > > "properties" : {  
> > > "title" : { "type" : "string", "analyzer" :  
> > > "index\_analyzer", "omit\_norms" : "yes" }  
> > > }  
> > > ...
> > 
> > > I would expect that my template 'initializes' the default settings for  
> > > the matching fields and I can overwrite those defaults under  
> > > properties ...
> > 
> > > Regards,  
> > > Peter.

---

<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:00am UTC](https://discuss.elastic.co/t/dynamic-template-behaviour/4875/5 "2017-07-06T04:00:22Z")

</div>


