4
votes

I am trying to index my data from oracle database in Solr. For this, I made a core named 'orca' in Solr. My database table name is school which has three fields namely id,name and pricipal. Following are my files:

schema.xml file:

 <uniqueKey>id</uniqueKey>
  <!-- Fields added for oracle school table load-->
 <field name="name" type="text_general" indexed="true" stored="true"/>
 <field name="principal" type="text_general" indexed="true" stored="true"/>

data-config.xml file:

<dataConfig>
    <dataSource name="jdbc" driver="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@localhost:1521/XE" user="system" password="*****"/>
    <document>
        <entity name="school" query="select * from school">
            <field column="id" name="id" />
            <field column="name" name="name" />
            <field column="principal" name="principal" />
        </entity>
    </document>
</dataConfig>

solrconfig.xml file:

   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-dataimporthandler-.*\.jar" />
   <lib dir="${solr.install.dir:../../../..}/contrib/extraction/lib" regex=".*\.jar" /> 
   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-cell-\d.*\.jar" /> 
   <lib dir="${solr.install.dir:../../../..}/contrib/clustering/lib/" regex=".*\.jar" /> 
   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-clustering-\d.*\.jar" /> 
   <lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /> 
   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" /> 
   <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" /> 
   <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /> 

  <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
    <lst name="defaults">
      <str name="config">data-config.xml</str>
    </lst>
  </requestHandler>

All these three files are located at solr-5.3.0\server\solr\orca\conf.

It is not giving any error but also not defining dataimport-handler.

I am not able to figure out what is the mistake. Please help!

1
I got same problem. Have you a solution?Scott Chu

1 Answers

2
votes

Do a check of just have 3 things :

  1. Loading the required jar lib statement in solrconfig.xml

  2. Adding the handler definition which points to your data-config file

  3. Add the data-config file.

If you are still facing the same issue get a good example on the same or copy all the files and then modify the changes as per your requirement.