我遇到了一个我似乎无法过去的问题。每当我启动Solr时,我都会收到错误:
org.apache.solr.common.SolrException: Unknown fieldtype 'int_us' specified on field partId
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:501)
at org.apache.solr.shcema.IndexSchema.<init>(IndexSchema.java:125)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:461)....
我的schema.xml文件如下所示:
<schema name="parts" version 1.5>
<type>
<fieldType name="text_en_US" class="solr.TextField" sortMissingLast="true">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory" />
<filter class="solr.LowerCaseFilterFacroty" />
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt" enablePositionIncrements="true" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="false" />
<filter class="solr.SnowballPorterFilterFactory" language="English" />
<filter class="solr.PhoneticFilterFactory" encoder="DoubleMetaphone" inject="true" />
<filter class="solr.RemoveDuplicatesTokenFilterFactory" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory" />
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords_en.txt" enablePositionIncrements="true" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" />
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.SnowballPorterFilterFacroty" language="English" />
</analyzer>
</fieldType>
<fieldType name="string_en_US" class="solr.StrField"></fieldType>
<fieldType name="int_us" class="solr.IntField"></fieldType>
</type>
<fields>
<field name="partId" type="int_us" indexed="false" stored="true" required="true" />
<field name="partNumber" type="String_en_US" indexed="false" stored="true" required="true" />
<field name="desc" type="text_en_US" indexed="true" stored="true" required="true" />
<field name="usage" type="text_en_US" indexed="true" stored="true" required="true" />
<field name="qty" type="String_en_US" indexed="false" stored="true" required="true" />
<field name="make" type="String_en_US" indexed="true" stored="false" required="true" />
<field name="year" type="int_us" indexed="true" stored="false" required="true" />
</fields>
</schema>
我尝试更改partId的字段类型,但无论如何都会得到相同的错误。 我在tomcat 7服务器上运行solr 3.5。有谁知道我做错了什么?如果这还不够,请告诉我,我会发布更多信息。
答案 0 :(得分:1)
不确定它是否为stackoverflow格式,但发布的架构是无效的xml
<schema name="parts" version 1.5>
应该是
<schema name="parts" version="1.5">
答案 1 :(得分:1)
尝试将<type>
更改为<types>
答案 2 :(得分:0)
当我使用
时,我遇到了与Solr 4.6相同的问题<field name="_version_" type="long" indexed="true" stored="true" />
只有<types>
的根元素更正才能解决此问题。
这是第一个答案。