We're using Solr 7 and running in production via docker images. I was reading the https://lucene.apache.org/solr/guide/7_4/schema-api.html guide to using the API and trying it to add a new field to an existing schema on a local instance when I got the following error:
{
"responseHeader":{
"status":0,
"QTime":9},
"errors":[{"errorMessages":"schema is not editable"}]}
So I wondered what is the best practice approach for updating a schema on a live system. Is it a case of editing the schema.xml on each node and restarting in turn?
You can either use managed-schema (ManagedIndexSchemaFactory) or classic schema.xml (ClassicIndexSchemaFactory), defined in the solrconfig.xml. The schema.xml doesn't allow change the schema via API. Also if using ManagedIndexSchemaFactory check if subtag name="mutable" is false, if so the change is disabled. If you are using SolrCloud and recent versions of Solr it is recommended to use managed-schema.