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 Jie Sun <js...@yahoo.com> on 2012/11/28 22:40:16 UTC

programmatically get dataDir setting from solrconfig.xml

I am trying to get the value of 'dataDir' that was set in solrconfig.xml.

other thank query solr with

http://[host]:8080/solr/default/admin/file/?contentType=text/xml;charset=utf-8&file=solrconfig.xml

and parse the dataDir element using some xml parser, then resolve all
possible environment variables and system properties (essentially same thing
solr core manager does) to get the value in my java program...

is there an admin URL or java API I can use to just get a setting defined in
solrconfig.xml?

eventually what I am trying to do is find the size of the index of a core. I
am trying to reconstruct the path to the core and do a 'du' on the file
system.

so the second question is: is there a better way to do this? 
thanks
Jie



--
View this message in context: http://lucene.472066.n3.nabble.com/programmatically-get-dataDir-setting-from-solrconfig-xml-tp4023108.html
Sent from the Solr - User mailing list archive at Nabble.com.