Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch : when to set omit_norms option as false

What is a good use case of the omit_norms option in elasticsearch? I could not find adequate explanation in es website.

like image 947
CodePredator Avatar asked Nov 26 '13 16:11

CodePredator


2 Answers

Norms are a value stored in the index alongside a field, and used for scoring. With the default scoring algorithm, this combines a lengthNorm (which serves to weigh short fields more heavily than long ones), and any field-level boosts. You can see more on the details of it in the Lucene documentation.

The LengthNorm aspect is mostly helpful on proper full-text fields. On more structured fields in which you don't need a field boost, you can safely omit them.

like image 61
femtoRgon Avatar answered Nov 09 '22 22:11

femtoRgon


Norms are enabled by default for all analyzed fields as they're used for scoring. Put in simple words, they make shorter fields get higher score than longer ones. Whenever one doesn't want that or don't want a field to contribute to _score, one could disable norms.

From Elastic 2.0 onwards, you could add "norms": { "enabled": false } while defining the field in the mapping.

For use cases such as logging, norms are not useful.

More details can be found in this article in elastic guide

like image 43
Devi Avatar answered Nov 10 '22 00:11

Devi