3
votes

I have one instance of SOLR with three different cores.
I created a solr.xml config file which specifies the schema file for each core, but, it is not recognized. The system still tries to load the default schema.xml (I removed it, so it fails).

For debugging purposes I left only one code in the solr.xml, here are the entries I have:

<solr persistent="false">
  <cores adminPath="/admin/cores" defaultCoreName="content" shareSchema="false">
        <core name="content" instanceDir=".">
                <property name="schema" value="conf/contentSchema.xml" />
        </core>
  </cores>
</solr>

The file `contentSchema.xml exists under [SOLR_HOME]/conf. Itried both just the file name and conf/filename

Don't even reach that phase, the error is:

SEVERE: java.lang.RuntimeException: Can't find resource 'schema.xml' in classpath or /usr/local/solr/./conf/', cwd=/usr/local/solr

3

3 Answers

2
votes

If you have source downloaded , check the multicore folder which demos the multicore configuration which you can refer and test. or refer @ http://svn.apache.org/repos/asf/lucene/dev/trunk/solr/example/multicore/

More @ http://wiki.apache.org/solr/CoreAdmin#Configuration - would be a good starting point.

The multicore need not be under the solr home folder and can be specified with -Dsolr.solr.home=multicore

The solr.xml is in the same folder as the core folders. The instance directory points to the core folders schemaName -- The name of the core's schema file (schema.xml by default) e.g.

<core name="content" instanceDir="content">
     <property name="schemaName" value="contentSchema.xml" />
</core>
1
votes

Read the document carefully, 'schema' is an ATTRIBUTE of core element, not a PROPERTY. so suppose you put 'myschema.xml' under core's conf folder:

<core ....>
   <property name="schema" value="myschema.xml" />
</core>

will cause can't find schema.xml in classpath or ...../conf error

Whereas,

<core .... schema='myschema.xml' />

will succeed.

Note: Lucid Imagination's doc may be out-of-date or maybe it's talking about a feature of a future version of Solr, I guess.

0
votes

This is what I finaly used and is working

<cores adminPath="/admin/cores" defaultCoreName="content">
    <core name="content" instanceDir="./content" />
    <core name="users" instanceDir="./users" />
    <core name="users_organizations" instanceDir="./users_organizations" />
</cores>

Under each of those directories I have a conf directory with it's own conf files, which they in turn also point to the right data folder (in the solrconfig.xml file)