Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change schema.xml without restarting Solr?

Tags:

solr

I've added "copyField source="product" dest="text"/" in schema.xml

solrconfig.xml

<requestHandler name="/select" class="solr.SearchHandler">
  <!-- default values for query parameters can be specified, these
       will be overridden by parameters in the request
  -->
  <lst name="defaults">
    <str name="echoParams">explicit</str>
    <int name="rows">10</int>
    <str name="df">text</str>
  </lst>
</requestHandler>

I restarted solr and loaded the data again to reflect changes made. My question is whether it is necessary to restart solr every time I make a change in schema.xml.

like image 283
user3322698 Avatar asked May 21 '14 11:05

user3322698


People also ask

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.

Where is Solr schema xml?

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.


1 Answers

You can issue a RELOAD command to the core -

http://localhost:8983/solr/admin/cores?action=RELOAD&core=core0

That would let you avoid restarting tomcat or jetty and avoid most of the downtime as it will keep the old core running until the new core is ready.

However there are a few things configuration wise that would require a restart. See https://issues.apache.org/jira/browse/SOLR-3592 and https://wiki.apache.org/solr/CoreAdmin#RELOAD

like image 153
John Petrone Avatar answered Oct 23 '22 19:10

John Petrone