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 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
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).
class ="org.apache.solr.handler.dataimport.DataImportHandler" >
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
driver ="com.mysql.jdbc.Driver"
url ="jdbc:mysql://SERVER/DATABASE"
user ="USERNAME"
password ="PASSWORD" />
The dataSource configuration attributes , query in entity tag and database fields must be modified to match your database structure. The Query given in the example is a simple Join of the drupal node and node revisions tables.
Now restart or start ApacheSolr using java -jar start.jar .
Hit the full-commit url (http://SERVER:PORT/solr/dataimport?command=full-import) and your website would start getting indexed.
0
0
data-config.xml
full-import
idle
1
1056
0
2010-02-22 14:46:35
Indexing completed. Added/Updated: 1056 documents. Deleted 0 documents.
2010-02-22 14:46:42
2010-02-22 14:46:42
1056
0:0:6.562
This response format is experimental. It is likely to change in the future.
Copyright © 2019- zicool.com 版权所有 湘ICP备2023022495号-2
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务