IK word breaker plug-in

Time:2021-8-13

What is an IK word breaker

Word segmentation: that is to divide a paragraph of Chinese or other words into keywords. When searching, we will segment our own information, segment the data in the database or index library, and then perform a matching operation. The default Chinese word segmentation is to treat each word as a word. For example, "I love programming" will be divided into "I love", "programming" and "programming", This obviously does not meet the requirements, so we need to install a Chinese word splitter IK to solve this problem.

If you use Chinese, it is recommended to use IK word splitter!

IK provides two word segmentation algorithms: IK_ Smart and IK_ max_ Word, where IK_ Smart is the least segmentation, IK_ max_ Word is the most fine-grained division!

IK word breaker plug-in

  • 3. Restart and observe es, and you can see that IK word breaker is loaded!

IK word breaker plug-in

  • 4. Elastic search plugin can view the loaded plug-ins through this command

IK word breaker plug-in

  • 5. Test with kibana

    View different word segmentation effects

ik_ Smart minimum segmentation

IK word breaker plug-in

ik_ max_ Word is the most fine-grained division, exhausting the possibility of thesaurus!

IK word breaker plug-in

IK word breaker plug-in
Discovery problem: radian ghost is disassembled
This kind of word we need needs needs to be added to the dictionary of our word splitter

IK word splitter adds its own configuration

IK word breaker plug-in
Loaded our custom DIC file
IK word breaker plug-in
Test it again

IK word breaker plug-in
In the future, we need to configure the word segmentation ourselves, so we can configure it in the custom DIC file!

This work adoptsCC agreement, reprint must indicate the author and the link to this article

Recommended Today

Java Engineer Interview Questions

The content covers: Java, mybatis, zookeeper, Dubbo, elasticsearch, memcached, redis, mysql, spring, spring boot, springcloud, rabbitmq, Kafka, Linux, etcMybatis interview questions1. What is mybatis?1. Mybatis is a semi ORM (object relational mapping) framework. It encapsulates JDBC internally. During development, you only need to pay attention to the SQL statement itself, and you don’t need to […]