Solr5.5.1 IK Chinese Word Segmentation configuration and use, solr5.5.1ik
Preface
All those who have used ipve.net know that pangu word segmentation is used when we build an Index Server and solve the search matching problem. It contains a dictionary. Since this international framework is used, Chinese Word Segmentation cannot be avoided. In particular, there are many special industries in China. For example, the oilfield system involves some specialized words from several aspects such as exploration, drilling, and production. Such as e-commerce, mobile phone, notebook, and notebook accessories. Automobiles, brands, vehicle series, vehicle models, and so on. This series of data involves the ranking of professionals in their respective fields, therefore, the ultimate goal of Chinese word segmentation is to solve the problem of accuracy and matching degree of search results.
IK search Preview
My univeral Core contains two pieces of data. The title and author of the second piece of data are both Chinese. Then I use the keyword q = title: ordinary to search for the second piece of data. If you haven't searched your index library, you can configure IK Chinese word segmentation.
Chinese Semantic Analysis
In the left-side menu Analysis of the index database Core, you can enter the complex Query [keyword] and select the corresponding field, click [Analysis Values] to help you analyze the current complex phrase and break down the several search keywords or keywords. If you cannot meet your professional vocabulary, you should start with the dictionary. I entered: ordinary world. After analysis, we can find two words: ordinary and world. That is, I used the ordinary search results in the previous figure.
Configuration and Use of Chinese Word Segmentation
1. Download the corresponding IK version. Solr5.5.1 deployed locally. Download the latest version.
2. copy the files under the ik directory to the tomcat/webapps/solr/WEB-INF/lib directory. The ik directory contains ext. dic And stopword. dic. You can check the content.
3. Modify schema. xml. My local name is univeral/conf/managed-schema. Add a Chinese Word Segmentation configuration node. The content is as follows:
<fieldType name="text_ik" class="solr.TextField"> <analyzer type="index" isMaxWordLength="false" class="org.wltea.analyzer.lucene.IKAnalyzer"/> <analyzer type="query" isMaxWordLength="true" class="org.wltea.analyzer.lucene.IKAnalyzer"/> </fieldType>
4. Modify the field type. I modified two fields.
<field name="title" type="text_ik" indexed="true" stored="true" required="true" multiValued="false" /><field name="author" type="text_ik" indexed="true" stored="true" required="true" multiValued="false" />
References: http://www.cnblogs.com/zhangweizhong/p/5593909.html
Remarks
If you have created an index before, configure the IK Chinese Word Segmentation and then modify the field type in schema. xml. Clear the index and recreate the index. OK. Success.