0
votes

I have a single core solr server. when solr was running, in one collection solrconfig.xml and schema.xml files replaced by mistake. now collection worked correctly and correctly response to request but valid file in conf folder is replaced by mistake files. surly if i reload collection, new bad files load and my collection not worked correctly.

is there a way than can get solrconfig.xml & schema.xml from running collection without considering solrconfig.xml and schema.xml files that exist in conf folder?

2

2 Answers

0
votes

You can read the current running schema and config through the Solr schema API and Solr config API.

Pay attention: the results of this APIs is not the original schema.xml or solrconfig.xml files but from that you can rebuild the originals.

Again, pay also attention that Solr config API is available only in recent version of Solr.

In older versions (I have tested version 4.8.1) are no API for the solr configuration, so there is no way to fully rebuild the solrconfig.xml file.

0
votes

You can retrieve the loaded configuration files using Solr Administration User Interface :

  • Go to http://<hostname>:<port>/solr.
  • Select your core in the dropdown menu in the left pane.
  • A menu apears below the selected core, select Files
  • Load the file you want

Or you can go straight to http://<hostname>/solr/#/<corename>/files?file=<filename>

See https://cwiki.apache.org/confluence/display/solr/Files+Screen

Solr version prior to 4.x shows a slightly different interface, if I remember correctly there is no core dropdown, solrconfig.xml & schema.xml appears right in the left pane.

On SolrCloud there is an additional dropdown list showing all collections in a given cluster, but you get the idea.

Note : Solr Admin UI shows you parsed files, so if you ever had to escape special characters, for example in a filter's regex that uses a <, you would have to re-escape it to &lt; once you get the file back in order to prevent parse error.