Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use IK word Separator in ElasticSearch

Shulou Source: shulou.com Published: 2022-06-02 05:53:59 10月03日 Update

ElasticSearch how to use IK word splitter, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

IK word splitter

What is the IK word splitter?

Word segmentation is to divide a paragraph of Chinese or other into keywords. When we search, we will segment our own information, segment the data in the database or index database, and then perform a matching operation. the default Chinese word segmentation is to regard each word as a word, and "I love China" will be divided into "I", "love", "China" and "country", which obviously does not meet the requirements. So we need to install the Chinese word splitter IK to solve this problem.

IK provides two word segmentation algorithms: ik_smart and ik_max_word, in which ik_smart is the least segmentation and ik_max_word is the finest segmentation.

Installation

After downloading, decompress it to the plugins of elasticsearch

Testing with kibana

Testing using ik_smart word Segmentation algorithm

Testing using ik_max_word word Segmentation algorithm

IK word splitter adds its own dictionary

Query "a bowl of Millet Congee" to get the following results

You need to configure your own dictionary in the IKAnalyzer.cfg.xml under the config path of the IK plug-in.

IK Analyzer extension configuration xiaomizhou.dic

Set up your own dictionary xiaomizhou.dic

Restart the ES load dictionary and test again

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Tags: Tests dictionaries algorithms Chinese data help configuration clear two information keywords content this Xiaomi Millet Congee I love plug-ins databases articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft OPPO Reno Shulou Information Huawei Linux