Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find schema.xml file in solr 6.0,so to configure it,am i supposed to add a new file,or it will happen automatically?

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!!

like image 874
Rishab Chirania Avatar asked May 19 '16 13:05

Rishab Chirania


People also ask

Where is schema XML in Solr?

The Solr schema. xml (typically found in the solr/conf/ directory) is where you tell Solr what types of fields you plan to support, how those types will be analyzed, and what fields you are going to make available for import and queries. Solr will then base its Lucene underbelly on what you define.

What is schema XML in Solr?

The Solr search engine uses a schema. xml file to describe the structure of each data index. This XML files determines how Solr will build indexes from input documents, and how to perform index and query time processing. As well as describing the structure of the index, schema.

Which file in the Solr home directory contains the configuration options settings for the Solr server instance?

Inside Solr's Home, you'll find these files: solr. xml specifies configuration options for your Solr server instance.


2 Answers

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).
like image 146
sendon1982 Avatar answered Oct 01 '22 23:10

sendon1982


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.

like image 36
Alexandre Rafalovitch Avatar answered Oct 02 '22 00:10

Alexandre Rafalovitch