solr6.6 Tutorial-Import data from the MySQL database (iii)

Source: Internet
Author: User
Tags solr

Finishing more than half a day solr6.6, finally is the solr6.6 in the configuration database out, online articles, each said, not a unified coverage solr6.6 version configuration of the post, this chapter I will configure some of the notes listed, due to time reasons, This film only describes how to import data one time, no incremental import, want to see the increase in the students can be in the later article.

1, configuration Preparation

The premise of this article is that you've already configured SOLR and created a new core, and we'll start with the Core_demo in the previous article.

2, modify Soreconfig.xml

In Soreconfig.xml's <requesthandler name= "/select" class= "SOLR. Searchhandler "> Add the following code:

    <requesthandler name="/dataimport"class="  Org.apache.solr.handler.dataimport.DataImportHandler">     <lst name="  Defaults">        <str name="config">data-config.xml </str>     </lst> </requestHandler>

Note: You need to confirm that there are no other dataimport in the file, if there is a direct replacement

Create the Data-config.xml file in the sibling directory, and then configure the database related properties

<?xml version= "1.0" encoding= "UTF-8"?>  <dataConfig>    <datasource name= "Source1" type= " Jdbcdatasource "              driver=" Com.mysql.jdbc.Driver "              url=" Jdbc:mysql://127.0.0.1:3306/ecejcallcenter              " user= "root"              password= "123456"/>    <document>        <entity name= "Cc_bill" datasource= "Source1" PK = "bill_id"             query= "select Cc_bill.bill_id,cc_bill. ' Name ', Cc_bill.address,cc_bill.city_name,cc_bill.create_ Time from Cc_bill "><field column= ' bill_id ' name= ' billid '/><field column= ' name ' name= ' name '/><field column= ' address ' name= ' address '/><field column= ' city_name ' name= ' cityname '/><field column= ' create_time ' Name= ' createtime ' datetimeformat= ' yyyy-mm-dd HH:mm:ss '/>        </entity>    </document></ Dataconfig>

For detailed configuration Please refer to: http://blog.csdn.net/boolbo/article/details/50352331

solr6.6 Tutorial-Import data from the MySQL database (iii)

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.