如果只想快速安装IK,本教程管用。下面看经过。

简介:

  • 下面讲有我已经打包并且编辑过的zip包,你可以在下面下载即可。
  • 当前讲解的IK分词器 包的 version 为1.8。

一、下载zip包。

下面有附件链接【ik-安装包.zip】,下载即可。

二、上传zip包。

下载后解压缩,如下图。

打开修改修改好后打成zip包。

# 'elasticsearch.version' version of elasticsearch compiled against
# You will have to release a new version of the plugin for each new
# elasticsearch release. This version is checked when the plugin
# is loaded so Elasticsearch will refuse to start in the presence of
# plugins with the incorrect elasticsearch.version.
#把这个版本号改成你对应的版本即可,如你的版本是2.2.0,就改成2.2.0
elasticsearch.version=2.0.0

/elasticsearch-2.0.0/plugins

在plugins/目录下上传,并且解压缩。此处注意目录结构必须是这样,如下图:

三、启动测试

呃,我们发现报错了。

[elasticsearch@iZ25x3wjytdZ elasticsearch-2.0.0]$ ./bin/elasticsearch
[2016-03-01 10:32:02,958][INFO ][node                     ] [Landslide] version[2.0.0], pid[11109], build[de54438/2015-10-22T08:09:48Z]
[2016-03-01 10:32:02,959][INFO ][node                     ] [Landslide] initializing ...
Exception in thread "main" java.lang.IllegalStateException: Unable to initialize plugins
Likely root cause: java.nio.file.FileSystemException: /home/elasticsearch/es/elasticsearch-2.0.0/plugins/ik.zip/plugin-descriptor.properties: Not a directory
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
        at java.nio.file.Files.newByteChannel(Files.java:317)
        at java.nio.file.Files.newByteChannel(Files.java:363)
        at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:380)
        at java.nio.file.Files.newInputStream(Files.java:108)
        at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:86)
        at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:306)
        at org.elasticsearch.plugins.PluginsService.(PluginsService.java:112)
        at org.elasticsearch.node.Node.(Node.java:144)
        at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)

一看我们就知道,他去找plugins/ik.zip 下的配置文件对吧。

解决方案是把这个ZIP包删除即可。

删除后再次启动。

[elasticsearch@iZ25x3wjytdZ elasticsearch-2.0.0]$ ./bin/elasticsearch
[2016-03-01 10:32:02,958][INFO ][node                     ] [Landslide] version[2.0.0], pid[11109], build[de54438/2015-10-22T08:09:48Z]
[2016-03-01 10:32:02,959][INFO ][node                     ] [Landslide] initializing ...
Exception in thread "main" java.lang.IllegalStateException: Unable to initialize plugins
Likely root cause: java.nio.file.FileSystemException: /home/elasticsearch/es/elasticsearch-2.0.0/plugins/ik.zip/plugin-descriptor.properties: Not a directory
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
        at java.nio.file.Files.newByteChannel(Files.java:317)
        at java.nio.file.Files.newByteChannel(Files.java:363)
        at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:380)
        at java.nio.file.Files.newInputStream(Files.java:108)
        at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:86)
        at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:306)
        at org.elasticsearch.plugins.PluginsService.(PluginsService.java:112)
        at org.elasticsearch.node.Node.(Node.java:144)
        at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:270)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)

我们从启动就看的出来,IK分词器安装成功。

[2016-03-01 10:34:28,803][INFO ][plugins                  ] [Big Wheel] loaded [analysis-ik], sites [head]

测试:

http://123.57.163.79:9200/_analyze?analyzer=ik&pretty=true&text=sojson在线工具真好用

{
  "tokens" : [ {
    "token" : "sojson",
    "start_offset" : 0,
    "end_offset" : 6,
    "type" : "ENGLISH",
    "position" : 0
  }, {
    "token" : "在线",
    "start_offset" : 6,
    "end_offset" : 8,
    "type" : "CN_WORD",
    "position" : 1
  }, {
    "token" : "工具",
    "start_offset" : 8,
    "end_offset" : 10,
    "type" : "CN_WORD",
    "position" : 2
  }, {
    "token" : "真好",
    "start_offset" : 10,
    "end_offset" : 12,
    "type" : "CN_WORD",
    "position" : 3
  }, {
    "token" : "好用",
    "start_offset" : 11,
    "end_offset" : 13,
    "type" : "CN_WORD",
    "position" : 4
  } ]
}

Elasticsearch教程(三),IK分词器安装 (极速版)的更多相关文章

  1. elasticsearch安装ik分词器(极速版)

    简介:下面讲有我已经打包并且编辑过的zip包,你可以在下面下载即可. 1.下载zip包.elasticsearch-analysis-ik-1.8.0.jar下面有附件链接[ik-安装包.zip],下 ...

  2. 七、Elasticsearch+elasticsearch-head的安装+Kibana环境搭建+ik分词器安装

    一.安装JDK1.8 二.安装ES 三个节点:master.slave01.slave02 1.这里下载的是elasticsearch-6.3.1.rpm版本包 https://www.elastic ...

  3. elasticsearch 之IK分词器安装

    IK分词器地址:https://github.com/medcl/elasticsearch-analysis-ik 安装好ES之后就可以安装分词器插件了 记住选择ES对应的版本 对应的有版本选择下载 ...

  4. 【ELK】【docker】【elasticsearch】2.使用elasticSearch+kibana+logstash+ik分词器+pinyin分词器+繁简体转化分词器 6.5.4 启动 ELK+logstash概念描述

    官网地址:https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-prod ...

  5. Elasticsearch 7.x - IK分词器插件(ik_smart,ik_max_word)

    一.安装IK分词器 Elasticsearch也需要安装IK分析器以实现对中文更好的分词支持. 去Github下载最新版elasticsearch-ik https://github.com/medc ...

  6. Elasticsearch拼音和ik分词器的结合应用

    一.创建索引时,自定义拼音分词和ik分词 PUT /my_index { "index": { "analysis": { "analyzer&quo ...

  7. Elasticsearch教程(二),IK分词器安装

    elasticsearch-analysis-ik  是一款中文的分词插件,支持自定义词库,也有默认的词库. 开始安装. 1.下载 下载地址为:https://github.com/medcl/ela ...

  8. linux(centos 7)下安装elasticsearch 5 的 IK 分词器

    (一)到IK 下载 对应的版本(直接下载release版本,避免mvn打包),下载后是一个zip压缩包 (二)将压缩包上传至elasticsearch 的安装目录下的plugins下,进行解压,运行如 ...

  9. Elasticsearch入门之从零开始安装ik分词器

    起因 需要在ES中使用聚合进行统计分析,但是聚合字段值为中文,ES的默认分词器对于中文支持非常不友好:会把完整的中文词语拆分为一系列独立的汉字进行聚合,显然这并不是我的初衷.我们来看个实例: POST ...

随机推荐

  1. 基于RRT的机器人自主探索建图

    一.方法讲解: 本项目分为三个部分:机器人周围一定范围内基于RRT的全局检测, 根据上一步检测的未知区域点执行sklearn.cluster.MeanShift聚类,获取聚类中心: 根据聚类中心计算各 ...

  2. poj 3678 Katu Puzzle 2-SAT 建图入门

    Description Katu Puzzle is presented as a directed graph G(V, E) with each edge e(a, b) labeled by a ...

  3. 如何用cookie保存用户的登录的密码和用户名

    思路:绘制一个简单的登录界面的Servlet并要在此页面中读取保存密码和用户名的cookie--->在登录处理界面的servlet中把用户名和密码保存到cookie中 //登录界面的Servle ...

  4. centos 7 服务器网卡做bond

    前期环境准备 [root@ /root] alibaba cloud#cat /etc/redhat-releaseCentOS Linux release 7.4.1708 (Core)[root@ ...

  5. 【查看linux配置】查看linux系统常用的命令,Linux查看系统配置常用命令

    一.linux CPU大小  cat /proc/cpuinfo |grep "model name" && cat /proc/cpuinfo |grep &qu ...

  6. struts2 json 输出日期格式不正确

    struts2 输出json中 日期出现:2013-12-17T15:57:47 错误格式的数据 原因:struts2 json插件对日期的格式化有问题 解决方法:在实体类的日期的get方法上加注解: ...

  7. UVA 10359 Tiling

    考虑最左边一列和最左边两列分别可以一个纵方块:2个横方块+2*2: 则f[i]=f[i-1]+2f[i-2]; #include <map> #include <set> #i ...

  8. vboxmanage查询正在运行的vbox虚拟机

    系统:linux通用,virtualbox5.0 每次用下面命令启动vm虚拟机时,发现没办法知道它的IP. $ vboxmanage startvm <vmname> --type hea ...

  9. Java解决跨域的方案

    在后台加上,在数据返回之前添加 response.setHeader("Access-Control-Allow-Origin","*"); 就可以了,前台不用 ...

  10. 【linux高级程序设计】(第十三章)Linux Socket网络编程基础 4

    网络调试工具 tcpdump 功能:打印指定网络接口中与布尔表达式匹配的报头信息 关键字: ①类型:host(默认).net.port host 210.27.48.2 //指明是一台主机 net 2 ...