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
>
上一篇: 正则表达式之正则处理函数_PHP教程
下一篇: 请问一个正则替换有关问题