Solr同义词搜索在添加空格时不起作用

时间:2016-06-14 15:46:29

标签: solr synonym

正如http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#SynonymFilter中所建议的,当在同义词中添加空格时,同义词搜索不起作用,即索引词是" marketing"添加的同义词如下: abc,abc xyz,marketing

我的架构如下:

<fieldType name="String" class="solr.TextField"  positionIncrementGap="100">
<analyzer type="index">
       <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
          <filter class="solr.LowerCaseFilterFactory"/>
          <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
    </analyzer>
       <analyzer type="query">
       <tokenizer class="solr.StandardTokenizerFactory"/>
       <charFilter class="solr.HTMLStripCharFilterFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"  enablePositionIncrements="true" />
        <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
    </fieldType>

我也尝试将<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>添加到<analyzer type="query">,但它不起作用。

请建议。

谢谢&amp;许多问候, Lalit Joshi

0 个答案:

没有答案