在Windows环境下安装Docker后,您可以使用以下步骤安装Elasticsearch 7.12.1和IK分词器:
-
拉取Elasticsearch 7.12.1镜像:
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.12.1
-
运行Elasticsearch容器:
docker run -d --name es7 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.12.1
-
拉取IK分词器的Docker镜像:
docker pull docker.elastic.co/elasticsearch/elasticsearch-ik:7.12.1
-
将IK分词器插件安装到Elasticsearch容器中:
docker exec -it es7 /bin/bash elasticsearch-plugin install https://artifacts.elastic.co/downloads/elasticsearch-plugins/ik/elasticsearch-ik-7.12.1.zip
-
重启Elasticsearch容器以使插件生效:
docker restart es7
完成上述步骤后,您的Elasticsearch 7.12.1实例将拥有安装好的IK分词器插件。您可以通过访问
http://localhost:9200
来验证Elasticsearch是否正常运行,并通过Elasticsearch的API测试IK分词器的效果