I am trying to add support for Simple Chinese on my Solr core. I try add the following to my schema.xml file:
<fieldType name="text_zh" class="solr.TextField" positionIncrementGap="100">
<analyzer class="org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer"/>
</fieldType>
The get thei following error when reloading the core:
yirmi: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core yirmi: Plugin init failure for [schema.xml] fieldType "text_zh": Cannot load analyzer: org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer. Schema file is /var/solr/data/yirmi/conf/schema.xml solr: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core solr: Error loading solr config from /var/solr/data/solr/conf/solrconfig.xml
When I try
<fieldType name="text_zh" class="solr.TextField" positionIncrementGap="100">
<!--<analyzer class="org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer"/>-->
<analyzer>
<tokenizer class="solr.HMMChineseTokenizerFactory"/>
<filter class="solr.CJKWidthFilterFactory"/>
<filter class="solr.StopFilterFactory"
words="org/apache/lucene/analysis/cn/smart/stopwords.txt"/>
<filter class="solr.PorterStemFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
I get the following error when loading the code:
yirmi: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
Could not load conf for core yirmi: Plugin init failure for [schema.xml] fieldType "text_zh": Plugin init failure for [schema.xml] analyzer/tokenizer: Error loading class 'solr.HMMChineseTokenizerFactory'. Schema file is /var/solr/data/yirmi/conf/schema.xml solr: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core solr: Error loading solr config from /var/solr/data/solr/conf/solrconfig.xml
How do I install the necessary plugins in order for the changes in schema.xml to work?
lucene-analyzers-smartcn-x.y.z.jar
file incontrib\analysis-extras\lucene-libs
to the lib statement in yoursolrconfig.xml
? – MatsLindh