加载课程时出错' solr.SmartChineseSentenceTokenizerFactory'

时间:2016-07-06 08:06:40

标签: solr

我正在使用solr 6,并且我已经定义了fieldType。

<fieldType name="text_zh" class="solr.TextField"
                   positionIncrementGap="100">
            <analyzer>
                <tokenizer class="solr.SmartChineseSentenceTokenizerFactory"/>
                <filter class="solr.SmartChineseWordTokenFilterFactory"/>
                <filter class="solr.LowerCaseFilterFactory"/>
            </analyzer>
        </fieldType>

当我启动服务器时,收到错误消息:

org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core new_core: Can't load schema /Users/i843100/Downloads/solr-6.1.0/server/solr/new_core/conf/schema.xml: Plugin init failure for [schema.xml] fieldType "text_zh": Plugin init failure for [schema.xml] analyzer/tokenizer: Error loading class 'solr.SmartChineseSentenceTokenizerFactory'

如何解决此错误?

1 个答案:

答案 0 :(得分:0)

HMMChineseTokenizerFactory用于更高版本的solr

<fieldType name="text_zh" class="solr.TextField"
            positionIncrementGap="100">
     <analyzer>
         <tokenizer class="solr.HMMChineseTokenizerFactory"/>
         <filter class="solr.StopFilterFactory"
                 words="org/apache/lucene/analysis/cn/smart/stopwords.txt"/>
         <!--filter class="solr.PorterStemFilterFactory"/-->
         <filter class="solr.LowerCaseFilterFactory"/>
     </analyzer>