I have been using Solr 1.4 on Tomcat and had been making use of the current 
working directory unknowingly.  I programmatically create cores as needed.  I 
create a core via the CoreAdmin by passing in the core name ( CORE_01 ), 
instancedir ( CORE_01 ), config ( solr/conf/solrconfig.xml ), and schema ( 
solr/conf/schema.xml ).  All of my cores share the same config and schema.  
This worked fine with Tomcast ( and Jetty ) as the paths the the config and 
schema were relative to where I had started tomcat.

 

for example:

/<solr_install_dir>  ---> location I start tomcat

/<solr_install_dir>/Tomcat ---> location of tomcat

/<solr_install_dir>/solr ---> Solr Home and location of solr.xml

/<solr_install_dir>/solr/conf ---> location of my shared schema.xml and 
solrconfig.xml

 

When trying to run with weblogic I was running from the same location ( 
/<solr_install_dir>).  It seemed that the cwd ( current working directory ) was 
the weblogic domain, not the location from which I had started weblogic.  
Setting the solr home via -Dsolr.solr.home=<solr_install_dir>/solr allowed the 
solr instance to start.  When creating the core as above I would get errors 
stating that the solrconfig.xml could not be found.  It was looking in the 
instancedir ( /<solr_install_dir?/solr/CORE_01 ) and the cwd which was pointing 
to my weblogic domain.

 

I notice that when passing in the instancedir to the CoreAdmin create that it 
would set the solr home to /<solr_install_dir>/solr/CORE_01, for example.  From 
there it would append “conf/” and what ever was passed in as the config, in my 
case /<solr_install_dir>/solr/CORE_01/conf/solr/conf/solrconfig.xml.  I then 
found that if I pass in "/" as the instancedir and CORE_01 as the data 
directory and passing in “solrconfig.xml” as the config that I could create the 
cores as desired.  It would append the “/” to the solr home when looking for 
the solrconfig.xml.  

 

The examples show passing in the instancedir as the name of the core.  This 
makes me question what is the suggested approach when creating cores 
programmatically with a shared config and schema.

 

Thanks,

Joe

 
                                          
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/196390710/direct/01/

Reply via email to