> ## Content Index
> Fetch the complete content index at: https://lucent.blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# Elasticsearch安装分词插件
- URL: https://lucent.blog/elasticsearchan-zhuang-fen-ci-cha-jian/
- Published: 2021-11-17T08:01:43.000Z
- Updated: 2026-08-21T00:49:57.000Z
- Author: Lucent

elasticsearch默认不支持中文分词，需要手动安装。

### 执行命令进入docker容器，安装分词插件

```shell
docker exec -it pce-elasticsearch sh

```

### 进入容器后执行如下命令安装ik分词插件

**需要注意的是 命令中的版本号要和elasticsearch版本对应**

```shell
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.9.3/elasticsearch-analysis-ik-7.9.3.zip

```

### 安装拼音分词

```shell
./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v7.9.3/elasticsearch-analysis-pinyin-7.9.3.zip

```

出现类似下图就成功了  

![image-20210527151651624](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20210527151651624.png)