13

I have created a new core named "testcore" in solR ,but in solR 6.0 I am not able to find Schema.xml file in conf folder,so am I supposed to manually create it or it will configure itself automatically?

I wanted to index a example from example docs,so to index it am I supposed to mention Schema.xml document or it will happen automatically as solR 6 is schemaless.

I am trying to folow this tutorial

https://examples.javacodegeeks.com/enterprise-java/apache-solr/apache-solr-tutorial-beginners/

please help!!

Vojtech Ruzicka
  • 16,384
  • 15
  • 63
  • 66
Rishab Chirania
  • 131
  • 1
  • 1
  • 4
  • Have you tried to rename "managed" schema to schema.xml ? – Oyeme May 20 '16 at 10:18
  • https://lucene.apache.org/solr/guide/6_6/schema-factory-definition-in-solrconfig.html#SchemaFactoryDefinitioninSolrConfig-Switchingfromschema.xmltoManagedSchema – serkan Nov 06 '17 at 14:40

3 Answers3

20

If you have started Solr with managed schema enabled and you would like to switch to manually editing a schema.xml file, you should take the following steps:

  1. Rename the managed-schema file to schema.xml

  2. Modify solrconfig.xml to replace the schemaFactory class.

    a. Remove any ManagedIndexSchemaFactory definition if it exists

<!-- An example of Solr's implicit default behavior if no schemaFactory is explicitly defined. --> <schemaFactory class="ManagedIndexSchemaFactory"> <bool name="mutable">true</bool> <str name="managedSchemaResourceName">managed-schema</str> </schemaFactory>

b. Add a ClassicIndexSchemaFactory definition as shown below

    <schemaFactory class="ClassicIndexSchemaFactory"/>
  1. Reload the core(s).
sendon1982
  • 9,982
  • 61
  • 44
17

Starting from Solr 6, all examples and sample configurations use managed schema approach. So, there is no more schema.xml file. Instead, there is managed-schema file and it is managed by the Solr itself. So, editing the file is not recommended, though still possible.

Instead, you can edit the schema via Admin UI as well now, in the Schema Browser section.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27
  • Hi @Alexandre so, do you mean if there is schema.xml instead of managed-schema.xml than it will not be able to find schema file at the time of creating new core? – Divyang Shah Dec 16 '16 at 05:47
  • It will look for managed-schema (not .xml). If Solr finds that, it will look for nothing else. If there is no managed-schema, it will look for schema.xml and convert that to managed-schema. – Alexandre Rafalovitch Dec 16 '16 at 06:56
0

if the solr server is running you can view the schema at http://localhost:8983/solr/#/<core_name>/files?file=managed-schema

S A
  • 187
  • 1
  • 2
  • 7