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)