solr 索引mysql DIH 链接
Download the JDBC Driver Download the JDBC Driver for MySQL from http://mysql.spd.co.il/Downloads/Connector-J/mysql-connector-java-3.1.14.zip Put the mysql-connector-java-3.1.14-bin.jar in Solr Dir/example/lib Configuring Solr to Use MySQL
Download the JDBC Driver
Download the JDBC Driver for MySQL from http://mysql.spd.co.il/Downloads/Connector-J/mysql-connector-java-3.1.14.zip
Put the "mysql-connector-java-3.1.14-bin.jar" in
Solr Dir/example/lib
Configuring Solr to Use MySQL
Solr can be configured to connect to a MySQL Data base using the DataImportHandler. To do so first in
solrconfig.xml
(This file would be in
Solr Dir/example/conf
) add a new requestHandler which is handled by DIH (DataImportHandler).
name
="/dataimport"
class
="org.apache.solr.handler.dataimport.DataImportHandler"
>
name
="defaults"
>
name
="config"
>
data-config.xml>
>
>
Create a new file called data-config.xml in the same directory and configure the database connection and table schema to reflect your database structure.
Sample data-config.xml
>