doker es
1.安装
https://www.cnblogs.com/vincenshen/p/10872372.html
docker run -it --name elasticsearch -d -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -p 127.0.0.1:5601:5601 elasticsearch:6.7.2
docker run -it -d -e ELASTICSEARCH_URL=http://127.0.0.1:9200 --name kibana --network=container:elasticsearch kibana:6.7.2
docker run -it --name elasticsearch-head -d -p 127.0.0.1:9100:9100 docker.io/mobz/elasticsearch-head:5
2.
es
127.0.0.1:9200
http://127.0.0.1:9200/user put //创建索引
http://127.0.0.1:9200/user/apply/7 put //添加或覆盖
http://127.0.0.1:9200/user/apply/6 get //获取文档或者索引
http://127.0.0.1:9200/user/apply/6/_update/ post //更改
http://127.0.0.1:9200/user/apply/2 delete //删除文档或者索引
http://127.0.0.1:9200/user/apply/_search get //搜索
http://127.0.0.1:9200/user/_analyze //分词
ik_max_word: 会将文本做最细粒度的拆分
ik_smart: 会做最粗粒度的拆分
{ "text":"中华人民共和国,国歌","tokenizer": "ik_smart"}
kibana
127.0.0.1:5601
head
//显示未连接 原因是es默认不支持跨域
vi config/elasticsearch.yml
//添加
http.cors.enabled: true
http.cors.allow-origin: "*"