# Disable norms for all fields

**URL:** https://discuss.elastic.co/t/disable-norms-for-all-fields/11602
**Category:** Elasticsearch
**Created:** [April 16, 2013, 6:58pm UTC](https://discuss.elastic.co/t/disable-norms-for-all-fields/11602 "2013-04-16T18:58:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Yadu](https://avatars.discourse-cdn.com/v4/letter/y/e95f7d/32.png) [@Yadu](https://discuss.elastic.co/u/Yadu)
#### Post date: [April 16, 2013, 6:58pm UTC](https://discuss.elastic.co/t/disable-norms-for-all-fields/11602/1 "2013-04-16T18:58:45Z")

</div>

My application doesn't need any kind of boost/score, we do plain boolean  
search. So I tried to disable norms at index time using dynamic template  
like

"dynamic\_templates" : [  
..................................  
....................................  
,{  
"template\_apply\_to\_all\_es\_fields" : {  
"match" : "\*",  
"mapping" : {  
"type": "{dynamic\_type}",  
"omit\_norms" : true,  
"index\_options" : "docs"  
}  
}  
}  
]

when I tried to save document it throws error:

```
{
   "error": "MapperParsingException[failed to find type parsed [{dynamic_type}] for [person]]",
   "status": 400
}

```

where 'person' is type of document and also the root node in the document.

Is "type": "{dynamic\_type}" is not a correct usage in this case?  
Is there any other way to disable norms for all fields including fields of  
nested objects?

I know we can disable norms by putting "omit\_norms" : true, "index\_options"  
: "docs" on every field mapping.

Thanks for your help!

-Yadu

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Yadu](https://avatars.discourse-cdn.com/v4/letter/y/e95f7d/32.png) [@Yadu](https://discuss.elastic.co/u/Yadu)
#### Post date: [April 16, 2013, 8:32pm UTC](https://discuss.elastic.co/t/disable-norms-for-all-fields/11602/2 "2013-04-16T20:32:50Z")

</div>

I ignored the fact that omit\_norms and index\_options are only for string  
type. So I added mapping given below for string fields identified  
dynamically. Each statically mapped string field requires omit\_norms and  
index\_options explicitly in its mapping.

{  
"template\_strings\_no\_norms" : {  
"mapping" : {  
"type" : "string",  
"omit\_norms" : true,  
"index\_options" : "docs"  
},  
"match" : "\*",  
"match\_mapping\_type" : "string"  
}  
}

Mappings are as expected now and working fine. But it seems score is still  
getting calculated which is weird.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Dominik\_Stadler](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@Dominik\_Stadler](https://discuss.elastic.co/u/Dominik_Stadler)
#### Post date: [December 19, 2016, 8:06am UTC](https://discuss.elastic.co/t/disable-norms-for-all-fields/11602/3 "2016-12-19T08:06:12Z")

</div>

There was a similar discussion at [How to disable "Norms" for all field?](https://discuss.elastic.co/t/how-to-disable-norms-for-all-field/27232) and the issue at [https://github.com/elastic/elasticsearch/issues/19716](https://github.com/elastic/elasticsearch/issues/19716) discusses this and there seems to be a working example provided there.

---

<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 5, 2017, 10:04pm UTC](https://discuss.elastic.co/t/disable-norms-for-all-fields/11602/4 "2017-07-05T22:04:50Z")

</div>


