You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2008/08/24 19:54:35 UTC

[Solr Wiki] Update of "CoreAdmin" by ShalinMangar

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by ShalinMangar:
http://wiki.apache.org/solr/CoreAdmin

The comment on the change is:
Added notes on using properties in solr.xml

------------------------------------------------------------------------------
  </solr>
  }}}
  
+ You can also specify properties in solr.xml which can be used in the solrconfig.xml and schema.xml files.
+ {{{
+ <solr persistent="true" sharedLib="lib">
+  <property name="snapshooter" value="/home/solr-user/solr/bin/snapshooter.sh" />
+  <cores adminPath="/admin/cores">
+   <core name="core0" instanceDir="core0">
+     <property name="dataDir" value="/data/core0" />
+   </core>
+   <core name="core1" instanceDir="core1" />
+  </cores>
+ </solr>
+ }}}
+ The properties can be container scope (i.e. specified after <solr> but outside of a <core> element) in which case it is automatically inherited by each core. Therefore, they can be used in any of the cores' configuration files.
+ 
+ The properties can also be defined in a core's scope (inside the <core> element) in which case they can be used only in that core's scope. If a property by that name already exists in the container scope then it will be overridden.
+ 
+ Besides them, a few properties are automatically added in the core scope. They are:
+  * solr.core.name -- The core's name as defined in solr.xml
+  * solr.core.instanceDir -- The core's instance directory (i.e. the directory under which that core's config and data directory are located)
+  * solr.core.configName -- The name of the core's config file (solrconfig.xml by default)
+  * solr.core.schemaName -- The name of the core's schema file (schema.xml by default)
+ 
+ Such properties can be used inside solrconfig.xml and schema.xml files by specifying an expression with optionally, a default value.
+ {{{
+ // Without a default value
+ ${snapshooter}
+ // With a default value
+ ${snapshooter:./solr/bin/snapshooter.sh}
+ }}}
+ The above expression will evaluate to the value specified in solr.xml for the property name "solr.snapshooter". If no value is defined in solr.xml, it will check if a system property by that name exists otherwise it will use the specified default value. If no default value is specified, a runtime exception will be thrown and the core may fail to startup.
+ 
  == solr ==
  The `<solr>` tag accepts two attributes:
    *'''persistent''' - By default, should runtime core manipulation be saved in ''solr.xml'' so that it is available after a restart.
@@ -34, +65 @@

  The `<core>` tag accepts two attributes:
    *'''name''' - The registered core name.  This will be how the core is accessed.
    *'''instanceDir''' - The ''solr.home'' directory for a given core.
+ 
+ == property ==
+ The `<property>` tag accepts two attributes:
+   *'''name''' - The name of the property
+   *'''value''' - The value of the property 
  
  = Example =
  
@@ -52, +88 @@

   http://localhost:8983/solr/core0/admin/
   
   http://localhost:8983/solr/core1/admin/
- 
  
  = CoreAdminHandler =