我正在使用标准的 Solr ngram 字段定义——
<fieldType name="ngram" class="solr.TextField" positionIncrementGap="100" stored="false" multiValued="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<!-- potentially word delimiter, synonym filter, stop words, NOT stemming -->
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.NGramFilterFactory" minGramSize="2" maxGramSize="15"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<!-- potentially word delimiter, synonym filter, stop words, NOT stemming -->
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<field name="item" type="text" indexed="true" stored="true"/>
<field name="item_ngram" type="ngram" indexed="true" stored="true"/>
现在“item:ipad AND item:2”找到“iPad 2”,但“item_ngram:ipad AND item_ngram:2”没有。
任何的想法?