我无法在schema.xml中分析WhitespaceAnalyzer

时间:2015-04-18 02:34:35

标签: solr

我在schema.xml中添加分析器

<fieldType name="nametext" class="solr.TextField">
        <analyzer class="org.apache.lucene.analysis.WhitespaceAnalyzer"/>
</fieldType>

然后在solr 5.0.0中重新加载核心,我收到以下错误:

testcore: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: 
Could not load conf for core testcore: Plugin init failure for [schema.xml]
fieldType "nametext": Cannot load analyzer:
org.apache.lucene.analysis.WhitespaceAnalyzer. Schema file is E:\files\future\solr-5.0.0\server\solr\testcore\conf\schema.xml

我错过了什么?

1 个答案:

答案 0 :(得分:0)

在Solr 5.0.0中,此类位于org.apache.lucene.analysis.core包中,因此该类应为org.apache.lucene.analysis.core.WhitespaceAnalyzer - 请参阅文档:http://lucene.apache.org/core/5_0_0/analyzers-common/index.html