I want to use the schema.xml rather than the managed schema so I changed the following in the solrconfig.xml to the below
<schemaFactory class="ManagedIndexSchemaFactory"> <bool name="mutable">true</bool> <str name="managedSchemaResourceName">managed-schema</str> </schemaFactory>
to
<schemaFactory class="ClassicIndexSchemaFactory"/>
But I get The indexschema is not mutable error when I try to Index a flat file using the post command.
The solrconfig. xml file is located in the conf/ directory for each collection. Several well-commented example files can be found in the server/solr/configsets/ directories demonstrating best practices for many different types of installations.
Remove the AddSchemaFieldsUpdateProcessorFactory
section from the updateRequestProcessorChain
config in your solrconfig.xml
The schemaFactory option in solrconfig.xml. This controls whether the Schema should be defined as a "managed index schema": schema modification is only possible through the Schema API. By default, if no schemaFactory is specified, then the default behavior is to use the "ClassicIndexSchemaFactory"
The ClassicIndexSchemaFactory requires the use of a schema.xml file, which can be edited manually and is only loaded only when the collection is loaded. This setting disallows Schema API methods that modify the schema.
When ManagedIndexSchemaFactory is specified instead, Solr will load the schema from he resource named in managedSchemaResourceName
, rather than from schema.xml.
AddSchemaFieldsUpdateProcessorFactory : This processor will dynamically add fields to the schema if an input document contains one or more fields that don't match any field or dynamic field in the schema.
read more on the same here https://lucene.apache.org/solr/4_6_0/solr-core/org/apache/solr/update/processor/AddSchemaFieldsUpdateProcessorFactory.html
In short the above process factory is used for managed schema. When one does not want to use ManagedIndexSchemaFactory it should be removed from the updateRequestProcessorChain.
For more details of it you can check out the solr code or read the source code of the AddSchemaFieldsUpdateProcessorFactory.java
Debug the method processAdd(AddUpdateCommand cm)
, will help more on the same.
With the updated version of Solr 7.2
you need to the update.autoCreateFields
to false
in the updateRequestProcessorChain
definition in solrconfig.xml
.
<updateRequestProcessorChain name="add-unknown-fields-to-the-schema" default="${update.autoCreateFields:false}" processor="uuid,remove-blank,field-name-mutating,parse-boolean,parse-long,parse-double,parse-date,add-schema-fields">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With