Docker-compose安装

  1. version: '3.3'
  2. services:
  3. elasticsearch:
  4. image: elasticsearch:6.4.3
  5. container_name: elasticsearch
  6. restart: always
  7. ports:
  8. - 9200:9200
  9. - 9300:9300
  10. environment:
  11. cluster.name: elasticsearch
  12. volumes:
  13. - /data/docker/elasticsearch/data:/usr/share/elasticsearch/data
  14. - /data/docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins

集成IK分词器

  1. wget https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.4.3/elasticsearch-analysis-ik-6.4.3.zip

解压:

  1. unzip elasticsearch-analysis-ik-6.4.3 -d analysis-ik

拷贝到插件目录

  1. cp -r analysis-ik plugins

集成拼音分词器

  1. wget https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v6.4.3/elasticsearch-analysis-pinyin-6.4.3.zip

解压:

  1. unzip elasticsearch-analysis-pinyin-6.4.3 -d analysis-pinyin

拷贝到插件目录

  1. cp -r analysis-pinyin plugins