SOLR WordDelimiterFilterFactory过滤器不搜索字母数字组合

时间:2018-03-23 05:07:53

标签: solr solr4

我有三个具有给定标题的内容项目:

BASECOAT PROCESS 4 STAGE - 90 LINE

BASECOAT PROCESS 3 STAGE - 90 LINE

BASECOAT PROCESS 2 STAGE - 90 LINE

现在,当我尝试使用术语2 STAGE进行搜索时,solr会将内容项的相关性与“BASECOAT PROCESS 4 STAGE - 90 LINE”标题相提并论。 所以它出现在列表的顶部。

实际上,根据术语,结果BASECOAT PROCESS 2 STAGE - 90 LINE应显示在顶部。

以下是schema.xml中的字段配置

<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <!-- Case insensitive stop word removal.
          add enablePositionIncrements=true in both the index and query
          analyzers to leave a 'gap' for more accurate phrase queries.
        -->
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.WordDelimiterFilterFactory"
                protected="protwords.txt"
                generateWordParts="1"
                generateNumberParts="1"
                catenateWords="1"
                catenateNumbers="0"
                catenateAll="1"
                splitOnCaseChange="0"
                preserveOriginal="1"/>
        <filter class="solr.LengthFilterFactory" min="1" max="100" />
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
        <filter class="solr.NGramFilterFactory" minGramSize="1" maxGramSize="25" />
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
      <analyzer type="query">
        <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory"
                ignoreCase="true"
                words="stopwords.txt"
                enablePositionIncrements="true"
                />
        <filter class="solr.WordDelimiterFilterFactory"
                protected="protwords.txt"
                generateWordParts="1"
                generateNumberParts="1"
                catenateWords="1"
                catenateNumbers="0"
                catenateAll="1"
                splitOnCaseChange="0"
                preserveOriginal="1"/>
        <filter class="solr.LengthFilterFactory" min="1" max="100" />
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.SnowballPorterFilterFactory" language="English" protected="protwords.txt"/>
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>

似乎tokenizer没有为单个整数值创建标记。

Protwords.txt => https://pastebin.com/Hwabu2Lk
Solr version => 4.10.2

为了调试,我使用WordDelimiterFilterFactory的各种值来玩,但没有任何线索。

0 个答案:

没有答案