Windows10 installation Elasticsearch IK word plug-in

Install plug

cmd switch to the install directory Elasticsearch

C:\Users\Administrator>D:

D:\>cd D:\Program Files\Elastic\ElasticSearch\6.8.4\bin

Installed plug-in needs to match the version with Elasticsearch, that I installed the 6.8.4 version of the plug-ik word.
Visit the download page: Releases · medcl / elasticsearch the Analysis-IK-
find download links 6.8.4, execute the following command

elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.8.4/elasticsearch-analysis-ik-6.8.4.zip

Examples of the results:

D:\Program Files\Elastic\Elasticsearch\6.8.4\bin>elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.8.4/elasticsearch-analysis-ik-6.8.4.zip
-> Downloading https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.8.4/elasticsearch-analysis-ik-6.8.4.zip
[=================================================] 100%??
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.net.SocketPermission * connect,resolve
See http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed analysis-ik

I do not know how to verify whether the installation is successful, you can use the help command elasticsearch-plugin -hto view the available commands

D:\Program Files\Elastic\Elasticsearch\6.8.4\bin>elasticsearch-plugin -h
A tool for managing installed elasticsearch plugins

Commands
--------
list - Lists installed elasticsearch plugins
install - Install a plugin
remove - removes a plugin from Elasticsearch

Non-option arguments:
command

Option         Description
------         -----------
-h, --help     show help
-s, --silent   show minimal output
-v, --verbose  show verbose output

Derived from the above, it can be used elasticsearch-plugin listto view the installed plug-ins too.

D:\Program Files\Elastic\Elasticsearch\6.8.4\bin>elasticsearch-plugin list
analysis-icu
analysis-ik

analysis-ik ik plug-in has been successfully installed.

Ik word test

Ik word test can be made in various ways

chrome browser plug elasticsearch-head

Download: elasticsearch Head - Chrome Web Store
if you can not Ahem, you can access mobz / elasticsearch-head: A web front end for an elastic search cluster follow the instructions to install itself.
The test results similar to the following screen

kibana basis Dev Tools

Postman

Custom dictionary

Dictionary configuration IKAnalyzer.cfg.xml, my configuration pathD:\ProgramData\Elastic\Elasticsearch\config\analysis-ik\

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
    <comment>IK Analyzer 扩展配置</comment>
    <!--用户可以在这里配置自己的扩展字典 -->
    <entry key="ext_dict"></entry>
     <!--用户可以在这里配置自己的扩展停止词字典-->
    <entry key="ext_stopwords"></entry>
    <!--用户可以在这里配置远程扩展字典 -->
    <!-- <entry key="remote_ext_dict">words_location</entry> -->
    <!--用户可以在这里配置远程扩展停止词字典-->
    <!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>

Initial configuration as shown above, the configuration files in the current directory, create a text file temp.dic
enter the following, storage, use different word line feed

如家
周树人

Modify the configuration is as follows, save, and then restart Elasticsearch service, you can expand the use of the dictionary.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
    <comment>IK Analyzer 扩展配置</comment>
    <!--用户可以在这里配置自己的扩展字典 -->
    <entry key="ext_dict">temp.dic;</entry>
     <!--用户可以在这里配置自己的扩展停止词字典-->
    <entry key="ext_stopwords"></entry>
    <!--用户可以在这里配置远程扩展字典 -->
    <!-- <entry key="remote_ext_dict">words_location</entry> -->
    <!--用户可以在这里配置远程扩展停止词字典-->
    <!-- <entry key="remote_ext_stopwords">words_location</entry> -->
</properties>

Multiple dictionaries, separated by a semicolon.

Guess you like

Origin www.cnblogs.com/AlienXu/p/elasticsearch-analysis-ik.html