Solr configure Chinese analyzer / define business domain / configure dataimport function method (for test)
1、 Configure Chinese analyzer
Using ikanalyzer
Configuration method:
1) Add the jar package of IK to the / WEB-INF / lib directory of Solr project
2) Expand the dictionary of IK configuration file and put it under classpath/ Under the WEB-INF / classes directory
3) In schema Defines fieldtype in XML, specifying that IK is used as the parser
4) Restart Tomcat
2、 Definition of business domain
1) Create database
Fields to be imported: PID, name, catalog_ name,price,description,picture
2) Each field needs to correspond to a field in the index library
A record corresponds to a document and a field corresponds to a field
schema. In XML:
3、 Configure dataimport function (for test)
Steps:
1. Add the jar package required by the dataimport plug-in to Solr
solr-dataimporthandler-4.10. 3.jar solr-dataimporthandler-extras-4.10. 3.jar
You can put it in the solrhome / Collection1 / lib directory
2. The jar package of database driver for MySQL is required
You can put it in the Collection1 / lib directory
3. It needs to be in solrconfig XML add a requesthandler processor
4. In solrconfig Add a data config. XML to the directory where the XML configuration file is located XML file
Configure the connection string to connect to the database
SQL statement for querying database
Mapping relationship between result set and index library
5. Restart Tomcat
The above Solr configuring Chinese analyzer / defining business domain / configuring dataimport function method (for testing) is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.