elasticsearch1.7.2 installing an IK word breaker

Source: Internet
Author: User

Try a lot of programs on the Internet is not the spirit!


Finally, I was to be made out. Record it and hope to help other people!


IK word breaker address: Https://github.com/medcl/elasticsearch-analysis-ik


1. Download Elasticsearch-analysis-ik-1.4.1.zip


2. Unzip, go to directory: command line execution: MVN compile package (make sure MAVEN is installed on the machine)

3. Enter Target\releases Copy the Elasticsearch-analysis-ik-1.4.1.zip file to the server, elasticsearch1.7.2 's installation directory, If plugins does not have analysis-ik this folder please create


4, with unzip decompression elasticsearch-analysis-ik-1.4.1.zip This file to Analysis-ik this folder (the most important, other tutorials do not have this step, or will be reported to find the class error)

5, enter the $es_home/config directory, the local D:\javastudy\es\elasticsearch-analysis-ik-1.4.1\config\ under the ik This file is copied to this directory (that is, the word breaker is copied to this directory)


6, the profile of the ES is added at the end of the configuration file: $ES _home/config/elasticsearch.yml

Index: Analysis  :    Analyzer:      ik:          alias: [Ik_analyzer]          type: Org.elasticsearch.index.analysis.IkAnalyzerProvider      Ik_max_word:          type:ik          use_smart:false      ik_ Smart:          Type:ik          Use_smart:trueindex.analysis.analyzer.default.type:ik



7. Restart ES

Close command: Curl-xpost http://localhost:19200/_cluster/nodes/_shutdown


8, carry out testing:

Curl ' http://localhost:9200/index/_analyze?analyzer=ik_max_word&pretty=true '-d ' {     "text": "National anthem of the People's Republic of China"} '

{"  tokens": [{    "token": "Text",    "Start_offset": Ten,    "End_offset": +,    "type": "中文版",    "p Osition ": 1  }, {    " token ":" People's Republic ",    " Start_offset ": +,    " End_offset ":"    Type ":" Cn_word ", c12/> "position": 2  }, {    "token": "National anthem",    "Start_offset": +,    "End_offset": +, "    type": "Cn_wo RD ",    " position ": 3  }]}



Ik_max_word: The text will be the most fine-grained split, such as will be "the national anthem of the People's Republic of China" divided into "People's Republic of China, the Chinese people, Chinese, Chinese, People's Republic, people, people, peoples, republics, republics, and, state, national anthem," will exhaust all possible combinations;

Ik_smart: Will do the most coarse-grained split, such as will be "the national anthem of the People's Republic of China" split into "People's Republic of China, the national anthem."













return:

elasticsearch1.7.2 installing an IK word breaker

Related Article

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.