Hi There is one more approach using the property mechanism.
You could specify the datasource like this: <dataSource name="database" driver="${sqlDriver}" url="${sqlURL}"/> And you can specifiy the properties in the solr.xml in your core configuration like this: <core instanceDir="core1" name="core1"> <property name="sqlURL" value="jdbc:hsqldb:/temp/example/ex"/> .... </core> Viele Grüße aus Augsburg Markus Klose SHI Elektronische Medien GmbH Adresse: Curt-Frenzel-Str. 12, 86167 Augsburg Tel.: 0821 7482633 26 Tel.: 0821 7482633 0 (Zentrale) Mobil:0176 56516869 Fax: 0821 7482633 29 E-Mail: markus.kl...@shi-gmbh.com Internet: http://www.shi-gmbh.com Registergericht Augsburg HRB 17382 Geschäftsführer: Peter Spiske USt.-ID: DE 182167335 -----Ursprüngliche Nachricht----- Von: Rahul Warawdekar [mailto:rahul.warawde...@gmail.com] Gesendet: Mittwoch, 11. Juli 2012 11:21 An: solr-user@lucene.apache.org Betreff: Re: DIH XML configs for multi environment http://wiki.eclipse.org/Jetty/Howto/Configure_JNDI_Datasource http://docs.codehaus.org/display/JETTY/DataSource+Examples On Wed, Jul 11, 2012 at 2:30 PM, Pranav Prakash <pra...@gmail.com> wrote: > That's cool. Is there something similar for Jetty as well? We use Jetty! > > *Pranav Prakash* > > "temet nosce" > > > > On Wed, Jul 11, 2012 at 1:49 PM, Rahul Warawdekar < > rahul.warawde...@gmail.com> wrote: > > > Hi Pranav, > > > > If you are using Tomcat to host Solr, you can define your data > > source in context.xml file under tomcat configuration. > > You have to refer to this datasource with the same name in all the 3 > > environments from DIH data-config.xml. > > This context.xml file will vary across 3 environments having > > different credentials for dev, stag and prod. > > > > eg > > DIH data-config.xml will refer to the datasource as listed below > > <dataSource jndiName="java:comp/env/<*YOUR_DATASOURCE_NAME*>" > > type="JdbcDataSource" readOnly="true" /> > > > > context.xml file which is located under "/<TOMCAT_HOME>/conf" folder > > will have the resource entry as follows > > <Resource name="<*YOUR_DATASOURCE_NAME*>" auth="Container" > > type="" username="XXXXX" password="XXXXX" > > driverClassName="" > > url="" > > maxActive="8" > > /> > > > > On Wed, Jul 11, 2012 at 1:31 PM, Pranav Prakash <pra...@gmail.com> > wrote: > > > > > The DIH XML config file has to be specified dataSource. In my > > > case, and possibly with many others, the logon credentials as well > > > as mysql > server > > > paths would differ based on environments (dev, stag, prod). I > > > don't > want > > to > > > end up coming with three different DIH config files, three > > > different handlers and so on. > > > > > > What is a good way to deal with this? > > > > > > > > > *Pranav Prakash* > > > > > > "temet nosce" > > > > > > > > > > > -- > > Thanks and Regards > > Rahul A. Warawdekar > > > -- Thanks and Regards Rahul A. Warawdekar