On 18.03.2010, at 23:12, Shawn Heisey wrote: > Below is my data-config.xml file, which I am using to build an index for my > first shard. I have a couple of questions. > > Can Solr include the hostname (short version) it's running on in the query? > Alternatively, is there a way to override the query with a URL parameter > before or when doing the full import? I'd like to avoid having to parse and > rewrite the config file. > > My ultimate goal is to write a completely generic query that gets the values > represented by 6, 0, and 229615984 in the example below from a small config > table, but I'll take baby steps in that direction. > > <dataConfig> > <dataSource type="JdbcDataSource" > driver="com.mysql.jdbc.Driver" > encoding="UTF-8" > > url="jdbc:mysql://[hostname]:3306/[database]?zeroDateTimeBehavior=convertToNull" > batchSize="-1" > user="[user]" > password="[password]"/> > <document> > <entity name="[table]" pk="did" > query="SELECT * FROM [table] WHERE (did % 6) = 0 AND 229615984 >= did"> > </entity> > </document> > </dataConfig>
I recently asked about this on this list. You can use request parameters in your DIH xml: http://wiki.apache.org/solr/DataImportHandler#Accessing_request_parameters However you can even also define default for these parameters inside your solrconfig.xml request handler configuration. regards, Lukas Kahwe Smith m...@pooteeweet.org