1

I want to import data from database directly into the solr index. I found this tutorial very helpful.

However I have a problem to get this to work. I first set up a requestHandler like this

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

data-config.xml:

<dataConfig>
  <dataSource type="JdbcDataSource" 
              driver="com.mysql.jdbc.Driver"
              url="jdbc:mysql://localhost/admin_pproject" 
              user="root" 
              password=""/>
  <document>
    <entity name="id" 
            query="select id from admin_pproject">
    </entity>
  </document>
</dataConfig>

When I run full import I get several errors:

enter image description here

Any ideas?

1 Answer 1

1

Try adding the full path to data-config.xml in solrconfig. Also, check what happens if you try to access http://localhost:8983/solr/admin/dataimport.jsp?handler=/dataimport from a browser.

If you still have problems, then please post the Jetty logs generated while starting Solr - they might provide clues.

Sign up to request clarification or add additional context in comments.

8 Comments

Are you sure you are editing the right files and restarting Jetty after changing the config files? Please shut down Jetty, clear the logs, start Jetty, fire the full-import command and post the full log file. Upload it on some server and provide a link if it is too big.
Well I did exactly what is described here wiki.apache.org/solr/DIHQuickStart and I restarted the server, this is the new log pastebin.com/nhfUVqwr
Well, I was expecting the log to show much more (I use Tomcat and a whole lot gets logged as soon as I start Solr/Tomcat, don't have any experience with Jetty, it might be different, or it might depend on the logging levels.) Just verify that you are editing the right config files - go to localhost:8983/solr/admin/file/?file=solrconfig.xml and check that the dataimport config is present.
thanks for the hint, I noticed that I have several solrconfig files, and actually it seems to be that I edited the wrong in example/solr/conf/...which should be edited?
Open localhost:8983/solr/admin/index.jsp and you will see SolrHome=<directory> towards the top. That is your home directory for Solr. The correct solrconfig to edit would be in the conf directory inside SolrHome.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.