ElasticSearch IK Tokenizer Quick Start

ElasticSearch IK Tokenizer Quick Start

1. Install IK word segmenter

1. Allocate a pseudo terminal

My ElasticSearch is installed using Docker, so first assign a pseudo terminal to the container. Then you can directly operate the contents in Docker just like logging into the server.
docker exec -it container ID /bin/bash

2. Install the plugin using elasticsearch-plugin

cd plugins Enter the plugins folder and execute the following command. 7.12.0 needs to be changed to your es version number

../bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.12.0/elasticsearch-analysis-ik-7.12.0.zip

3. Restart the elasticsearch container

docker restart container id

4. Frequently Asked Questions

(1)java.lang.IllegalStateException

When executing elasticsearch-plugin install, Failed installing and java.lang.IllegalStateException appeared

I checked and found that there is already a folder named ik in my plugins/ directory.
With a try-it attitude, I deleted the folder named ik and re-executed

../bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.12.0/elasticsearch-analysis-ik-7.12.0.zip

Installation Successful

2. ik word segmentation principle

(Placeholder, I will add more when I have time to read the source code)

3. ik_smart and ik_max_word

GET _analyze?pretty{ "analyzer": "ik_smart", "text": "Unlike me, I only feel sorry for pigeons"}

GET _analyze?pretty{ "analyzer": "ik_max_word", "text": "Unlike me, I only feel sorry for pigeons"}

in conclusion

_analyzer builds the index when the word segmentation, when the index uses max_word
search_analyzer uses word segmentation when searching and smart when querying

<<:  Development is accelerating again, and 5G plans and goals for major provinces and cities in my country are released!

>>:  Using Jenkins to create continuous integration for microservice applications

Recommend

LOCVPS 20% off: 29.6 yuan/month - 1GB/30GB/400GB@100Mbps/Osaka, Japan

LOCVPS is a domestic hosting company founded in 2...

Can the 5G industry really succeed?

[[419120]] Last month, the Ministry of Industry a...

5G technology: enabling the Internet of Things and ultra-high-speed connectivity

In the digital age where seamless connectivity an...

Learn about MQTT protocol in one article

Today we will talk about the MQTT protocol in det...

Insufficient CMDB Momentum = “Failed” IT Operations?

Whether it is the implementation of ITIL in the e...

Four network capabilities that digital enterprises should focus on

We live in an increasingly digital world where ou...

IT Viewpoint: Five major network challenges for 2019

Frank Scalzo, network director at data center ope...

spinservers San Jose China Telecom Network VPS Simple Test

Some time ago, I shared the information about spi...