Solr index mysqlDIH Link

Source: Internet
Author: User
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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.