You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Radha C." <cr...@ceiindia.com> on 2009/04/01 16:31:45 UTC

How to get the solrhome location dynamically

Hello List,
 
I am having trouble in identifying the xml location which is exist inside
solrhome, I am having the input xml at $solrhome/inputdata/example.xml, 
Can anyone have idea about how to get solrhome location dynamically by using
any solrj API class? Any help will be greatly appriciated.

Re: How to get the solrhome location dynamically

Posted by Chris Hostetter <ho...@fucit.org>.
: Subject: How to get the solrhome location dynamically

Do you really want the Solr Home Dir, or do you want the instanceDir for a 
specific SolrCore?

If you're using a solr.xml file (ie: one or many cores), you can get hte 
instanceDir for each core from the CoreAdminHandler -- but it doesn't 
expost the actual SolrHomeDir where the solr.xml file was found.

If you aren't using a solr.xml file (ie: you definitely only have one 
core) you can get the instance dir from the SystemInfoRequestHandler 
(/admin/system in the example configs) ... and since you aren't using a 
solr.xml file, the instance dir is the same as the Solr Home Dir.


(Hmmmm... I suppose the CoreAdminHandler should probably expose metadta 
about the CoreContainer ... anyone want to work up a patch?)





-Hoss