Typically, a DIH configuration has nothing to do with using a single instance of Solr or multiple instances in a solrCloud configuration. DIH will write data to the current instance of the Lucene index, and then to zooKeeper to speed it up in other instances.
Make sure your DIH is configured correctly:
In the solrconfig.xml file, all the necessary libraries are loaded. This means that two cans of DIH:
<lib dir="../../../dist/" regex="solr-dataimporthandler-4.3.0.jar" /> <lib dir="../../../dist/" regex="solr-dataimporthandler-extras-4.3.0.jar" />
as well as other banks that you may need (for example, a JDBC database driver, etc.).
In the solrconfig.xml file, verify that the DIH handler is declared, for example:
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">data-config.xml</str> </lst> </requestHandler>
Finally, the configuration file that you specified in the DIH handler (data-config.xml) must be in the same conf directory as in the solrconfig.xml file and must have the appropriate content, for example:
<dataConfig> <dataSource type="JdbcDataSource" name="myDataSource" driver="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@someHost:1521:someDb" user="someUser" password="somePassword" batchSize="5000"/> <document name="myDoc" > <entity name="myDoc" dataSource="myDatasource" transformer="my.custom.Transformer" query="select col1, col2, col3 from table1 where whatever" /> </document> </dataConfig>
Shivan dragon
source share