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 wojtekpia <wo...@hotmail.com> on 2009/02/18 01:23:49 UTC

Reading Core-Specific Config File in a Row Transformer

I'm using the DataImportHandler to load data. I created a custom row
transformer, and inside of it I'm reading a configuration file. I am using
the system's solr.solr.home property to figure out which directory the file
should be in. That works for a single-core deployment, but not for
multi-core deployments (since I'm always looking in
solr.solr.home/conf/file.txt). Is there a clean way to resolve the actual
conf directory path from within a custom row transformer so that it works
for both single-core and multi-core deployments?

Thanks,

Wojtek
-- 
View this message in context: http://www.nabble.com/Reading-Core-Specific-Config-File-in-a-Row-Transformer-tp22069449p22069449.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Reading Core-Specific Config File in a Row Transformer

Posted by wojtekpia <wo...@hotmail.com>.
Thanks Shalin. I think you missed the call to .getResourceLoader(), so it
should be:

context.getSolrCore().getResourceLoader().getInstanceDir()

Works great, thanks!


Shalin Shekhar Mangar wrote:
> 
> 
> You can use Context.getSolrCore().getInstanceDir()
> 
> 

-- 
View this message in context: http://www.nabble.com/Reading-Core-Specific-Config-File-in-a-Row-Transformer-tp22069449p22086846.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Reading Core-Specific Config File in a Row Transformer

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Wed, Feb 18, 2009 at 5:53 AM, wojtekpia <wo...@hotmail.com> wrote:

>
> Is there a clean way to resolve the actual
> conf directory path from within a custom row transformer so that it works
> for both single-core and multi-core deployments?
>

You can use Context.getSolrCore().getInstanceDir()

-- 
Regards,
Shalin Shekhar Mangar.