2016-07-06 85 views
0

我正在使用solr 6,並且我定義了下面的fieldType。加載類'solr.SmartChineseSentenceTokenizerFactory'時出錯'

<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' 

如何解決這個問題?

回答

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>