Solr拼写检查配置问题

时间:2018-11-26 16:07:08

标签: search solr spell-checking

我的Solrcongig配置文件如下:

<searchComponent name="spellcheck" class="solr.SpellCheckComponent">

        <str name="queryAnalyzerFieldType">text_general</str>

        <!-- Multiple "Spell Checkers" can be declared and used by this
             component
          -->

        <!-- a spellchecker built from a field of the main index -->
        <lst name="spellchecker">
          <str name="name">default</str>
          <str name="field">contentSpell</str>
          <str name="classname">solr.DirectSolrSpellChecker</str>
          <str name="buildOnCommit">true</str>

我的schema.xml文件如下:

 <copyField source="*" dest="contentSpell"/>
 <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
    <analyzer type="index">
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
      <filter class="solr.LowerCaseFilterFactory"/>
       <filter class="solr.StandardFilterFactory"/>
    </analyzer>
    <analyzer type="query">
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.StopFilterFactory" words="stopwords.txt" ignoreCase="true"/>
      <filter class="solr.SynonymGraphFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/>
      <filter class="solr.LowerCaseFilterFactory"/>
      <filter class="solr.StandardFilterFactory"/>
    </analyzer>
  </fieldType>

当我在solr-data-config中提供字段类型时,即用COMPANYNAME_s代替contentSpell <str name="field">contentSpell</str>

拼写检查仅适用于此字段,但我希望它适用于字段。

我在配置下尝试过,但是没有用。

0 个答案:

没有答案