/    /  Solr – Schema Design

Solr – Schema Design:

In Solr, Schema.xml file is very important file in which the schema information is stored like details about the field types, fields, Unique key, how to index and search fields etc. schema file can be identified with the name Managed-schema under the Config directory Solr home.

By default, Solr uses the Managed schema unless we specify in the solrconfig.xml file with the tag <schemaFactory>

Example of <schemaFactory/> in solrconfig.xml file :

 <schemaFactory class="ManagedIndexSchemaFactory">
 <bool name="mutable">true</bool>
 <str name="managedSchemaResourceName">managed-schema</str>

If you want to change the name of the managed-schema.xml to schema.xml, just edit the name of the managed-schema.xml file to schema.xml. Modify the schemaFactory class from ManagedIndexSchemaFactory to ClassicIndexSchemaFactory

 <schemaFactory class="ClassicIndexSchemaFactory"/>

Though I am not copy paste the contents of schema file to give you a clarity, I can show you the structure of the schema file. Please take a look at the example below.