Sto cercando di ottenere un core Solr in esecuzione con il mio schema.xml
, ma Solr (versione 5.2.1) continua a lamentarsi degli elementi mancanti fieldType
che non sono nemmeno nelle definizioni fields
.Errore Solr che crea core: fieldType [x] non trovato nello schema
org.apache.solr.common.SolrException: fieldType 'booleans' not found in the schema
Ogni volta che posso aggiungere un 'mancante' fieldtype
un altro errore si apre lamentarsi un'altra fieldType
mancanti, come longs
, ecc, fino a quando li ho aggiunti e lo schema viene accettato senza errori.
Ora, come mai devo fornire questi elementi quando non li usano?
In config.xml
ho:
<schemaFactory class="ClassicIndexSchemaFactory"/>
Ecco la mia 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>
Non c'è un singolo multiValued
campo in là. Tuttavia, ho provato a impostare esplicitamente multiValued='false'
per ogni campo singolarmente, ma inutilmente. Anche quando spoglio l'intero schema solo su una manciata di campi String
, questo errore viene comunque generato.
Sono abbastanza fiducioso il mio schema.xml
è OK ma forse qualche impostazione da qualche parte dovrebbe dire Solr a prendersela comoda.
Sembra una soluzione molto più elegante del semplice commento dell'intera cosa. Per funzionare, ho dovuto usare ** ManagedIndexSchemaFactory ** invece di ** ClassicIndexSchemaFactory **, impostare 'mutable = true' e usare un nome diverso da schema.xml – acdhirr
in' Solr 6.3.0' funziona anche. La sezione necessaria può essere trovata in 'solrconfig.xml'. A proposito, dovevo anche rimuovere 's' da' tdates', 'tlongs' e da' tdoubles'. Ho preso 'solrconfig.xml' da' basic_configs'. – TitanFighter