对于Solr的一般属性(General Properties), 它适用于任何Field Type. 有以下一般属性:
Property | Description | Values |
name | ||
class | ||
positionIncrementGap | For multivalued fields, specifies a distance between multiple values, which prevents spurious phrase matches. 对于多值域来说, 在值域之间指定一个距离来防止伪短语的匹配。 |
integer |
autoGeneratePhraseQueries | For text fields. If true, Solr automatically generates phrase queries for adjacent terms. If false, terms must be enclosed in double-quotes to be treated as phrases. 对于text field(solr.TextField), 如果为true, Solr自动地将相邻的词生成短语查询语句。如果为False, terms根据TokenizerFactory划分为不同的短语。 |
true or false |
docValuesFormat | Defines a custom DocValuesFormat to use for fields of this type. This requires that a schema-aware codec, such as the SchemaCodecFactory has been configured in solrconfig.xml. 定义DocValues的存储格式。 |
n/a |
postingsFormat | Defines a custom PostingsFormat to use for fields of this type.This requires that a schema-aware codec, such as the SchemaCodecFactory has been configured in solrconfig.xml. | n/a |
- PositionIncrementGap example:
假如一个document有一个叫"author" 的 multi-valued 域, 值为:
author: John Doe
author: Bob Smith
当PositionIncrementGap =0时, 查询语句(Query):"doe bob", 会匹配这个Field, 显然这不是所希望看到的, 那么 PositionIncrementGap 会解决这个问题, 如:
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true"> </fieldType>
2. autoGeneratePhraseQueries, example:
<fieldType name="text_en_splitting" class="solr.TextField" autoGeneratePhraseQueries="true" positionIncrementGap="100">
</fieldType>
<fieldType name="text_ja" class="solr.TextField" autoGeneratePhraseQueries="false"></fieldType>