Error creating error Solr: fieldType [x] not found in schema

I am trying to start the Solr kernel with my own schema.xml , but Solr (version 5.2.1) continues to complain about the absence of fieldType elements that are not 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 occurs due to the absence of another fieldType , such as longs , etc., until I add all of them and the scheme will be accepted without errors.

Now, why should I provide these fieldType elements when they are not needed?

In config.xml I have:

 <schemaFactory class="ClassicIndexSchemaFactory"/> 

Here is 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 are no multiValued fields in multiValued . However, I tried to explicitly set multiValued='false' for each field separately, but to no avail. Even when I split the entire schema down to several String fields, it still generates this error.

I'm pretty sure my schema.xml is fine, but maybe some tweak somewhere should tell Solr to make this easy.

+6
source share
2 answers
 <lst name="typeMapping"> <str name="valueClass">java.lang.Boolean</str> <str name="fieldType">booleans</str> </lst> 

here you need to fix "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 links

https://lucene.apache.org/solr/4_6_0/solr-core/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.html

http://events.linuxfoundation.org/sites/events/files/slides/whats-new-in-apache-solr.pdf

+4
source

Not sure if this is the preferred way, but commenting on the solr.AddSchemaFieldsUpdateProcessorFactory section in config.xml seems to solve the problem.

 <!-- <processor class="solr.AddSchemaFieldsUpdateProcessorFactory"> <str name="defaultFieldType">strings</str> <lst name="typeMapping"> <str name="valueClass">java.lang.Boolean</str> <str name="fieldType">booleans</str> </lst> <lst name="typeMapping"> <str name="valueClass">java.util.Date</str> <str name="fieldType">tdates</str> </lst> <lst name="typeMapping"> <str name="valueClass">java.lang.Long</str> <str name="valueClass">java.lang.Integer</str> <str name="fieldType">tlongs</str> </lst> <lst name="typeMapping"> <str name="valueClass">java.lang.Number</str> <str name="fieldType">tdoubles</str> </lst> </processor> --> 
+6
source

All Articles