DownloadtheJDBCDriverDownloadtheJDBCDriverforMySQLfrommysql.spd.co.ilDownloadsConnector-Jmysql-connector-java-3.1.14.zip Putthemysql-connector-java-3.1.14-bin.jarinSolrDirexamplelibConfiguringSolrtoUseMySQL
Download the JDBC Driver for MySQL from the 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 locking ing 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
Using ing 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 wocould 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 usingJava-jar start. jar.
Hit the full-commit url (http: // SERVER: PORT/solr/dataimport? Command = full-import) and your website wocould 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.