Solr 6.3将rawquerystring拆分为两个字母对

时间:2019-03-06 18:57:34

标签: solr

我的Solr 6.3.0将rawquerystring解析为窗口2个字母对。

例如,当我搜索“源”时,Solr会将其解析为[“ so”,“ ou”,“ ur”,“ rc”,“ ce”]。

  "debug":{
    "rawquerystring":"source",
    "querystring":"source",
    "parsedquery":"+text_all:so +text_all:ou +text_all:ur +text_all:rc +text_all:ce",
    "parsedquery_toString":"+text_all:so +text_all:ou +text_all:ur +text_all:rc +text_all:ce"

text_all被定义为

<field indexed="true" multiValued="true" name="text_all" omitNorms="false" omitPositions="false" omitTermFreqAndPositions="false" stored="false" termVectors="false" type="text_general" />

并将text_general定义为

   <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
         <tokenizer class="solr.NGramTokenizerFactory" minGramSize="2" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
         <filter class="solr.LowerCaseFilterFactory" />
         <filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
      <analyzer type="query">
         <tokenizer class="solr.NGramTokenizerFactory" minGramSize="2" />
         <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" />
         <filter class="solr.LowerCaseFilterFactory" />
      </analyzer>
   </fieldType>

有任何建议吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

这是因为NGramTokenizerFactory