omitNorms for field in solr schema(转载地址:http://blog.csdn.net/fengzanfeng/article/details/22056121)

来源:互联网 发布:我们的大数据时代2017 编辑:程序博客网 时间:2024/05/16 01:56

首先看一下官方的介绍:http://wiki.apache.org/solr/SchemaXml

omitNorms=true|false
1. This is arguably an advanced option.
2. Set to true to omit the norms associated with this field (this disables length normalization and index-time boosting for the field, and saves some memory). Only full-text fields or fields that need an index-time boost need norms.



设置 omitNorms=false 意味着忽略掉 field 的 norms,相当于禁用掉了 length normalization 和 索引时 boosting;

1. length normalization:越短的文档,得分越高;
2. boost:boost 越大,得分越高;
3. 计算方法如下:

norm(t,d)   =   lengthNorm  · f.boost() field f in d named as t



omitNorms="true" on a field will have following effect: 

1. length normalization will not work on the specific field--> Which means matching documents with shorter length will not be preferred/boost over matching documents with greater length for the specific field, at search time. 

2. Index time boosting will not be available on the field. 


If, both the above cases are not required by you, then, you can set "omitNorms=true" for the specific fields. 

This has an added advantage, it will save you some(or a lot of) RAM also, since, with "omitNorms=false" on total "N" fields in the index will require RAM of size:  Total docs in index * 1 byte * N




0 0
原创粉丝点击