Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr (4.4+) solrconfig.xml location when creating cores

Tags:

solr

I'm Trying to setup a multi core solr server for our webapplication but i'm having trouble creating new core through the coreadmin service.

I'm using Solr-4.4 because 4.3 ran into problems persisting the cores in solr.xml (datadir wasn't preserved) So i'm using the new Solr.xml configuration 4.4 and beyond

My solr.xml currently looks like:

<solr>
  <str name="coreRootDirectory">default-instance/cores/</str>
</solr>

solrconfig.xml is located at (solrhome)/default-instance/conf/solrconfig.xml

When trying to create a core with the url

http:/example.org/solr/admin/cores?action=CREATE&name=test-name&schema=schema-test.xml&loadOnStartup=false

gives me the error:

Error CREATEing SolrCore 'test-name': Unable to create core: test-name Caused by: Can't find resource 'solrconfig.xml' in classpath or 'default-instance/cores/test-name/conf/', cwd=/var/lib/tomcat7

The following seems to work:

http:/example.org/solr/admin/cores?action=CREATE&name=test-name&schema=schema-test.xml&loadOnStartup=false&config=/absolute/file/path/to/solrconfig.xml

The problem is this only seems to work with a absolute path (or possibly a relative path from /var/lib/tomcat7) which is not a workable solution.

What i'm looking for is a way to place solrconfig.xml so it can be used to create new cores with that config (or a way the create those cores with the current location).

More or less the same will be needed for schemas

like image 289
pvgoddijn Avatar asked Jul 25 '13 13:07

pvgoddijn


People also ask

Where is Solrconfig xml located?

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.

Where are Solr cores stored?

Any core. properties file in any directory of your Solr installation (or in a directory under where solr_home is defined) will be found by Solr and the defined properties will be used for the core named in the file. In standalone mode, solr. xml must reside in solr_home .

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.


1 Answers

This worked. Ran on command line and was viewable in admin console:

solr create -c (name for core or collection)

See README.txt for more info.

like image 131
Andrew Betts Avatar answered Oct 05 '22 08:10

Andrew Betts