Toggle navigation
首页
技术
骑行
羽毛球
资讯
联络我
登录
Install-ik-plugin-with-docker-image
2017-05-26
Elasticsearch
Docker
# Use elasticsearch docker image Here is the official docker image of elasticsearch : https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html You can follow this article to setup elasticsearch in your environment easily. # Install ik plugin Here is an example to build your own image based on the official image: ``` FROM docker.elastic.co/elasticsearch/elasticsearch:5.3.0 RUN mkdir plugins/ik RUN wget -P plugins/ik https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v5.3.0/elasticsearch-analysis-ik-5.3.0.zip RUN unzip -d plugins/ik/ plugins/ik/elasticsearch-analysis-ik-5.3.0.zip EXPOSE 9200 9300 ``` The image will build with ik which's version is 5.3.0. You can get which version you should install from here : https://github.com/medcl/elasticsearch-analysis-ik. Elasticsearch will auto install plugins in the plugins folder, so what you need to do is download plugins to the folder. # Config the default analyzer for index 1. Create index. ``` PUT /blog ``` 2. Stop index created above. You can't change the default analyzer to an opened index, so you must close it first. ``` POST /blog/_close ``` 3. Set analyzer ``` PUT /blog/_settings { "index":{ "analysis" : { "analyzer" : { "default" : { "type" : "ik_smart" } } } } } ``` 4. Open index ``` POST /blog/_open ``` Now you can check whether the default analyzer was changed successfully: ``` GET /blog/_settings ```
×
本文为博主原创,如需转载,请注明出处:
http://www.supperxin.com
返回博客列表