Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use IKAnalysis Segmentation in Elasticsearch6.0

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

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

1. Install the plug-in

If it is in cluster mode, each node needs to install ik participle. After installing the plug-in, you need to restart the service. If a machine does not install participle before creating mapping, the index may be RED and need to be deleted and rebuilt.

. / bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.0.0/elasticsearch-analysis-ik-6.0.0.zip

two。 Create an index

You can use the CURL command, version 6.0 + can also debug API in the DevTools of the Kibana plug-in x-pack

Curl-XPUT http://localhost:9200/index

3. Create mappiing

4. Create a document

Curl-XPOST http://localhost:9200/index/fulltext/1-d' {"content": "is the United States leaving Iraq a mess?" curl-XPOST http://localhost:9200/index/fulltext/2-d'

{"content": "Ministry of Public Security: local school buses will enjoy the highest right of way"} 'curl-XPOST http://localhost:9200/index/fulltext/3-d' {"content": "investigation into the conflict between Chinese and Korean fishing police: South Korean police detain an average of one Chinese fishing boat a day." curl-XPOST http://localhost:9200/index/fulltext/4-d' {"content": "the suspect who was shot by an Asian man at the Chinese consulate in Los Angeles surrendered"}'.

5. Query document

IK supports custom configuration thesaurus, configuration files in the config folder analysis-ik/IKAnalyzer.cfg.xml, dictionary files are also in the same directory, can support multiple options configuration, ext_dict- custom thesaurus, ext_stopwords- shielded thesaurus.

At the same time, it also supports hot update configuration, configure remote_ext_dict to http address, enter a word per line, note that the document format should be UTF8 without BOM format, if the thesaurus is updated, you only need to update any field Last-Modified or ETag in response header.

IK Analyzer extension configuration custom/mydict.dic;custom/single_word_low_freq.dic custom/ext_stopword.dic location http://xxx.com/xxx.dic will it be 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: Configuration thesaurus support plug-ins files documents updates formats indexes China help maximum clear one line Asian public security at the same time siblings commands multiple Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Redmi Shulou Tech Info Huawei vpn