ElasticSearch5.3 Install IK word breaker and verify _elasticsearch

Source: Internet
Author: User

ElasticSearch5.3 Install IK word breaker

Previous use of the Elasticsearch installation head plugin succeeded, but the installation of IK participle failed. It appears that ElasticSearch5.0 later does not support the direct configuration of IK in elasticsearch.yml. The reason is explained below.
First Download:
Https://www.elastic.co/downloads/elasticsearch
Https://github.com/medcl/elasticsearch-analysis-ik
, the latest version seems to be 5.3.

First step preprocessing: Decompression elasticsearch-5.3.0.zip>d:\programfiles\softtools\elasticsearch\elasticsearch-5.3.0 Decompression elasticsearch-analysis-ik-5.3.0>d:\programfiles\softtools\elasticsearch\plugins\ elasticsearch-analysis-ik-5.3.0 Compile Elasticsearch-analysis-ik plugin cmd>d:\programfiles\softtools\elasticsearch\ PLUGINS\ELASTICSEARCH-ANALYSIS-IK-5.3.0>MVN Clean Package

Second Step configuration:

IK configuration, the following figure is the configuration of the IK Word breaker config directory D:\programfiles\softtools\elasticsearch\plugins\elasticsearch-analysis-ik-5.3.0\ Config

Create a new IK folder in the D:\programfiles\softtools\elasticsearch\elasticsearch-5.3.0\config directory, put the IK configuration file in the image above in the Elasticsearch directory of D : \programfiles\softtools\elasticsearch\elasticsearch-5.3.0\config\ik Directory


The contents of IK are the second step: 1. The configuration inside the IK configuration.
3. Configure IK word breaker
The following figure is a ZIP package compiled with the MVN command

Put the zip package in the image above into D:\programfiles\softtools\elasticsearch\elasticsearch-5.3.0\plugins\ik (Ps:ik directory does not have a new one is good), for decompression
The results are shown in the following illustration:


The entire installation is complete.

Third Step test:
1. Modify the configuration in Elasticsearch.yml
Set the Cluster.name,node.name and unlock the comments for both configurations
Set http.port:9200, others do not need to increase configuration
2. Windows Double-click D:\programfiles\softtools\elasticsearch\elasticsearch-5.3.0\bin\elasticsearch.bat
No error indicates successful installation.

3. Install the HTTP connection Access tool, such as Firefox plug-in Httprequester, after the installation will be in the top right corner of Firefox browser plugin logo.
4. Create an index

Content to send: {"settings": {"Analysis
        ": {"
            Analyzer": {
                "ik": {"
                    tokenizer": "Ik_smart" c6/>}}}
    ,
    "mappings": {"
        logs": {"
            dynamic": True,
            "Properties": {
                " Message ': {
                    ' type ': ' String ',
                    ' analyzer ': ' Ik_smart '
                }
    }}}

Click the Put button, the return value appears to the right of the graph, indicating that the index was successfully created.
5. For Word segmentation test:

The pits encountered during the installation process:
1. Placing the online configuration with IK in elasticsearch.yml will be reported as an error:
Org.elasticsearch.bootstrap.StartupException:java.lang.IllegalArgumentException:node settings must not contain any Index level settings
No matter how you think about it, and not a few people on the Internet have encountered this situation.

2.Caused By:java.lang.IllegalStateException:jar hell!
The jar that was compiled from IK, and source.jar two files into Elasticsearch's Lib appeared, it was said to be a version problem, but I chose both the latest version and the corresponding. This is because Lib has an IK, and then elasticsearch to read the plugin under the plugin folder when loaded again, so there is this problem. The IK jar package in Lib is deleted, and the change from plugins to Riga is no problem. A lot of it is done on the Internet, but it's not true.
You will see the appropriate error log in D:\programfiles\softtools\elasticsearch\elasticsearch-5.3.0\logs.
3. Exception in thread ' main ' java.lang.IllegalStateException:Could not ' load plugin descriptor for existing plugin [analy Sis-ik]. Was the plugin built before 2.0?
Likely root cause:java.nio.file.NoSuchFileException:/home/es/es2/plugins/analysis-ik/ Plugin-descriptor.properties
The exception that appears above is that I started to put the compiled jar bag into the D:\programfiles\softtools\elasticsearch\elasticsearch-5.3.0\plugins\ik inside, in fact, to put the D:\ Programfiles\softtools\elasticsearch\plugins\elasticsearch-analysis-ik-5.3.0\target\releases\ Elasticsearch-analysis-ik-5.3.0.zip extract to the IK directory below.
4. Why not configure IK-related participle properties in elasticsearch.yml?
5. Https://github.com/medcl/elasticsearch-analysis-ik's use of the documentation on GitHub said:

5.0.0 and its future will not be above two word breaker, and use two parameters to replace, and according to the use of the document above, the author also does not indicate to the IK configuration elasticsearch.yml.
Overall, or encountered a certain bumpy, online many es of the article for the new version is not applicable. I removed the 5.0.0 installation environment and then introduced the latest version to get the IK word breaker sorted. The latest version of the ES install head plugin should be no problem, after all, head also did not require the 5.0.0 version of the installation configuration changes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.