Elasticsearch : when to set omit_norms option as f

2019-03-24 17:29发布

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

2条回答
你好瞎i
2楼-- · 2019-03-24 18:00

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.

查看更多
不美不萌又怎样
3楼-- · 2019-03-24 18:08

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

查看更多
登录 后发表回答