Solr错误创建核心:fieldType [x]在模式中找不到 [英] Solr error creating core: fieldType [x] not found in the schema
问题描述
schema.xml
,但Solr(版本5.2.1)不断抱怨缺少 c> $ $ $ org.apache.solr.common.SolrException:在模式中找不到fieldType'booleans'
每当我添加一个'missing' fieldtype
时,出现另一个错误,抱怨另一个 fieldType
code> longs
等等,直到我添加了所有的,并且接受没有错误的模式。 当没有使用它们时,我必须提供这些 fieldtype
元素?
在 .xml
我有:
< schemaFactory class =ClassicIndexSchemaFactory/&
这是我的 schema.xml
:
< schema name =collectionsversion =1.5>
< fields>
< field name =id_objecttype =stringindexed =truestored =true/>
< field name =id_organizationtype =stringindexed =truestored =true/>
< field name =titletype =stringindexed =truestored =true/>
< field name =artisttype =stringindexed =truestored =true/>
< field name =searchnametype =stringindexed =truestored =true/>
< field name =technique_grouptype =stringindexed =truestored =true/>
< field name =techniquetype =stringindexed =truestored =true/>
< field name =color_typetype =stringindexed =truestored =true/>
< field name =colortype =stringindexed =truestored =true/>
< field name =subjecttype =stringindexed =truestored =true/>
< field name =heighttype =tintindexed =truestored =true/>
< field name =widthtype =tintindexed =truestored =true/>
< field name =depthtype =tintindexed =truestored =true/>
< field name =price_saletype =tfloatindexed =truestored =true/>
< field name =price_rentaltype =tfloatindexed =truestored =true/>
< field name =price_rental_with_savingstype =tfloatindexed =truestored =true/>
< field name =savings_portiontype =tfloatindexed =truestored =true/>
< field name =yeartype =tintindexed =truestored =true/>
< field name =is_for_renttype =booleanindexed =truestored =true/>
< field name =is_for_saletype =booleanindexed =truestored =true/>
< field name =statustype =stringindexed =truestored =true/>
< field name =shipmenttype =tfloatindexed =truestored =true/>
< field name =timestamptype =tdateindexed =truestored =truedefault =NOW/>
<! - catch all字段,如果其任何源字段为 - >必须为multiValued。
< field name =quick_searchtype =textindexed =truestored =false/>
<! - mandatory - >
< field name =_ version_type =tlongindexed =truestored =true/>
< / fields>
< uniqueKey> id_object< / uniqueKey>
< copyField source =id_objectdest =quick_search/>
< copyField source =titledest =quick_search/>
< copyField source =artistdest =quick_search/>
< copyField source =searchnamedest =quick_search/>
< copyField source =technique_groupdest =quick_search/>
< copyField source =techniquedest =quick_search/>
< copyField source =color_typedest =quick_search/>
< copyField source =colordest =quick_search/>
< copyField source =subjectdest =quick_search/>
< types>
< fieldtype name =stringclass =solr.StrField/>
< fieldtype name =booleanclass =solr.BoolField/>
< fieldtype name =tintclass =solr.TrieIntField/>
< fieldtype name =tlongclass =solr.TrieLongField/>
< fieldtype name =tfloatclass =solr.TrieFloatField/>
< fieldtype name =tdateclass =solr.TrieDateField/>
< fieldtype name =textclass =solr.TextField/>
< / types>
< / schema>
没有一个 multiValued
那里。尽管如此,我尝试为每个字段单独显式设置 multiValued ='false'
,但无效。即使当我将整个模式剥离到只有少数 String
字段时,它仍会生成该错误。
'm很有信心我的 schema.xml
是确定的,但也许某些地方的某些设置应该告诉Solr容易。
< lst name =typeMapping>
< str name =valueClass> java.lang.Boolean< / str>
< str name =fieldType> booleans< / str>
< / lst>
在这里你需要将booleans改为boolean。
< lst name =typeMapping>
< str name =valueClass> java.lang.Boolean< / str>
< str name =fieldType> boolean< / str>
< / lst>
然后就可以了。
请检查链接
http://events.linuxfoundation.org/sites/events/files/slides/whats-new-in-apache-solr.pdf
I am trying to get a Solr core running with my own schema.xml
, but Solr (version 5.2.1) keeps complaining about missing fieldType
elements that aren't even in my fields
definitions.
org.apache.solr.common.SolrException: fieldType 'booleans' not found in the schema
Whenever I add a 'missing' fieldtype
another error pops up complaining about another fieldType
missing, like longs
, etc., until I've added them all and the schema is accepted without error.
Now how come I must provide these fieldtype
elements when there is no use for them?
In config.xml
I have:
<schemaFactory class="ClassicIndexSchemaFactory"/>
Here's my schema.xml
:
<schema name="collections" version="1.5">
<fields>
<field name="id_object" type="string" indexed="true" stored="true" />
<field name="id_organization" type="string" indexed="true" stored="true" />
<field name="title" type="string" indexed="true" stored="true" />
<field name="artist" type="string" indexed="true" stored="true" />
<field name="searchname" type="string" indexed="true" stored="true" />
<field name="technique_group" type="string" indexed="true" stored="true" />
<field name="technique" type="string" indexed="true" stored="true" />
<field name="color_type" type="string" indexed="true" stored="true" />
<field name="color" type="string" indexed="true" stored="true" />
<field name="subject" type="string" indexed="true" stored="true" />
<field name="height" type="tint" indexed="true" stored="true" />
<field name="width" type="tint" indexed="true" stored="true" />
<field name="depth" type="tint" indexed="true" stored="true" />
<field name="price_sale" type="tfloat" indexed="true" stored="true" />
<field name="price_rental" type="tfloat" indexed="true" stored="true" />
<field name="price_rental_with_savings" type="tfloat" indexed="true" stored="true" />
<field name="savings_portion" type="tfloat" indexed="true" stored="true" />
<field name="year" type="tint" indexed="true" stored="true" />
<field name="is_for_rent" type="boolean" indexed="true" stored="true" />
<field name="is_for_sale" type="boolean" indexed="true" stored="true" />
<field name="status" type="string" indexed="true" stored="true" />
<field name="shipment" type="tfloat" indexed="true" stored="true" />
<field name="timestamp" type="tdate" indexed="true" stored="true" default="NOW" />
<!-- catch all field, must be multiValued if any of its source fields is -->
<field name="quick_search" type="text" indexed="true" stored="false" />
<!-- mandatory -->
<field name="_version_" type="tlong" indexed="true" stored="true" />
</fields>
<uniqueKey>id_object</uniqueKey>
<copyField source="id_object" dest="quick_search" />
<copyField source="title" dest="quick_search" />
<copyField source="artist" dest="quick_search" />
<copyField source="searchname" dest="quick_search" />
<copyField source="technique_group" dest="quick_search" />
<copyField source="technique" dest="quick_search" />
<copyField source="color_type" dest="quick_search" />
<copyField source="color" dest="quick_search" />
<copyField source="subject" dest="quick_search" />
<types>
<fieldtype name="string" class="solr.StrField" />
<fieldtype name="boolean" class="solr.BoolField" />
<fieldtype name="tint" class="solr.TrieIntField" />
<fieldtype name="tlong" class="solr.TrieLongField" />
<fieldtype name="tfloat" class="solr.TrieFloatField" />
<fieldtype name="tdate" class="solr.TrieDateField" />
<fieldtype name="text" class="solr.TextField"/>
</types>
</schema>
There is not a single multiValued
field in there. Nonetheless I tried explicitly setting multiValued='false'
for each field individually, but to no avail. Even when I strip the entire schema down to just a handful of String
fields it still generates that error.
I'm pretty confident my schema.xml
is OK but perhaps some setting somewhere should tell Solr to take it easy.
<lst name="typeMapping">
<str name="valueClass">java.lang.Boolean</str>
<str name="fieldType">booleans</str>
</lst>
over here you need to correct "booleans" to "boolean".
<lst name="typeMapping">
<str name="valueClass">java.lang.Boolean</str>
<str name="fieldType">boolean</str>
</lst>
Then it will work..
Please check the links
http://events.linuxfoundation.org/sites/events/files/slides/whats-new-in-apache-solr.pdf
这篇关于Solr错误创建核心:fieldType [x]在模式中找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!