欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

solr 索引mysql DIH 链接

程序员文章站 2022-05-30 19:03:38
...

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

>