Search code examples
solrsolrclouddataimporthandler

Unable to get data from dataimport.properties to config solr


I am using dataimporthandler for solr. I am trying to put some data in the dataimport.properties file for my db-data-config.xml

Here is my config file :

<dataConfig>
 <dataSource batchSize="-1" driver="${dataimporter.driverName}"
.....

here is my dataimport.properties file:

#Thu May 04 06:49:58 UTC 2017
driverName=com.mysql.jdbc.Driver
last_index_time=2017-05-04 06\:49\:51
IndData.last_index_time=2017-05-04 06\:49\:51

if i put the exact driver name in my config file it works. But i want that data from my properties file.

Can someone please help me regarding that.


Solution

  • I don't think dataimport.properties file allows you to put any arbitrary piece of data there and use it later in the DIH.

    What you can do on the other hand is:

    1. keep your driverName value in your own .properties file
    2. upon callilng DIH, add this to the request url

       /dataimport&command=full-import&clean=false&commit=true&driverName=com.mysql.jdbc.Driver
      
    3. and it should be picked up in your current db-data-config.xml