Skip to content

Instantly share code, notes, and snippets.

@RedactedProfile
Forked from maxivak/00. tutorial.md
Created October 13, 2015 18:16
Show Gist options
  • Select an option

  • Save RedactedProfile/7806a7b08e80a2e2d3a2 to your computer and use it in GitHub Desktop.

Select an option

Save RedactedProfile/7806a7b08e80a2e2d3a2 to your computer and use it in GitHub Desktop.
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler

Install Solr

download and install Solr from http://lucene.apache.org/solr/.

you can access Solr admin from your browser: http://localhost:8983/solr/

use the port number used in installation.

MySQL connector

Download JDBC driver for MySQL from http://dev.mysql.com/downloads/connector/j/.

Copy file from the downloaded archive 'mysql-connector-java-*.jar' to the folder 'contrib/dataimporthandler/lib' in the folder where Solr was installed. Create 'lib' folder if needed.

Setup a new collection

create a new folder for a new collection - 'myproducts'. The collection will be located in '/solr/myproducts' folder.

solrconfig.xml

copy solrconfig.xml from an existing collection and edit the file by adding:

Make sure that 'dist' folder contains two files for data import handler:

  • solr-dataimporthandler-4.10.2.jar
  • solr-dataimporthandler-extras-4.10.2.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment