elasticsearch7.5 安装ik分词

1、es集群安装完毕

2、下载IK

源码下载:https://github.com/medcl/elasticsearch-analysis-ik
在这里插入图片描述

3、解压到到ES_HOME/plugins/ik目录下面(直接包含一个conf文件夹和一堆.jar包)

重新启动ES,启动 看到try load config ……IK相关信息,说明启动完成和安装IK插件完成。

4、测试例子:

在Kibana的Dev Tools中,运行

GET _analyze?pretty
 
{
        "analyzer":"ik_smart",
        "text":"中国人民警察的服务宗旨"
}

5、索引模版

PUT _template/logstash-kafka
{
    "order" : 6,
    "version" : 60001,
    "index_patterns" : [
      "logstash-kafka*"
    ],
    "settings" : {
      "index" : {
        "refresh_interval" : "60s",
        "number_of_shards" : "3",
        "analysis.analyzer.default.type": "ik_max_word",
        "translog" : {
          "sync_interval" : "60s",
          "durability" : "async"
        },
        "number_of_replicas" : "1"
      }
    },
    "mappings" : {
      "dynamic_templates" : [
        {
          "message_field" : {
            "path_match" : "message",
            "mapping" : {
              "norms" : false,
              "type" : "text"
            },
            "match_mapping_type" : "string"
          }
        },
        {
          "string_fields" : {
            "mapping" : {
              "norms" : false,
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "ignore_above" : 256,
                  "type" : "keyword"
                }
              }
            },
            "match_mapping_type" : "string",
            "match" : "*"
          }
        }
      ],
      "properties" : {
        "@timestamp" : {
          "type" : "date"
        },
        "geoip" : {
          "dynamic" : true,
          "properties" : {
            "ip" : {
              "type" : "ip"
            },
            "latitude" : {
              "type" : "half_float"
            },
            "location" : {
              "type" : "geo_point"
            },
            "longitude" : {
              "type" : "half_float"
            }
          }
        },
        "@version" : {
          "type" : "keyword"
        }
      }
    },
    "aliases" : { }
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值