How to setup solr MySQL data importer

Written by: Open Solr Administrator

If you don't feel like creating your own data importer to import data from your SQL database to your SOLR collections, we've also integrated the DIH  - Data Import Handler which now helps you define your SQL connection and query, and import your data to SOLR with just a few clicks.

Here's a demo video on how to edit the SQL connection that will enable you to start importing data to your SOLR collections:

db-data-cofig.xml example:<dataConfig>

  <dataSource type="JdbcDataSource" 
    <entity name="id" 
            query="select id,name,desc from mytable">
NOTE !!!
Ensure that your solr schema (schema.xml) has the fields 
'id', 'name', 'desc'. Change the appropriate details in the data-config.xml