Elasticsearch default provided by the word breaker, will separate each character, not what we want according to keywords to participle, such as we want to "Chinese", "China", "I" such participle, so need to install Chinese word-breaker IK to achieve this function.
Elasticsearch-analysis-ik is a Chinese word breaker, support custom thesaurus, the specific installation steps are as follows:
1. Download the latest IK participle source from GitHub to local
Mode 1) can be downloaded via the git command, with the following code:
git clone Https://github.com/medcl/elasticsearch-analysis-ik
Mode 2) Manual download
Download the source code to the GitHub website at: Https://github.com/medcl/elasticsearch-analysis-ik, with a button "Download ZIP" below the right, Click here to download source code Elasticsearch-analysis-ik-master.zip
2, unzip the file Elasticsearch-analysis-ik.zip, execute the command:
Unzip Elasticsearch-analysis-ik.zip
Copy the entire directory of config/ik/in the Elasticsearch-analysis-ik-master directory to the config directory of the Elasticsearch installation directory, The elasticsearch.yml file in the config file in the Elasticsearch-analysis-ik-master directory is then overwritten with the elasticsearch.yml file in the Config directory elasticsearch the installation directory.
3, into the extracted folder directory, because the source code needs to use the MAVEN command package, execute the following command:
MVN Clean Package
If you do not have the Maven tool installed, you will need to install the Maven tool first, referring to the address:
http://www.yoodb.com/article/display/340
After executing the above command, the word breaker package for IK is ready.
4. Run the plugin command in the bin directory under the Elasticsearch installation path to install the newly compiled word breaker, with the following command:
Plugin-install Analysis-ik-url file:///#{project_path}/elasticsearch-analysis-ik/target/releases/ Elasticsearch-analysis-ik-1.4.0.zip
Elasticsearch Installing Chinese word segmentation plugin IK