ElasticSearch 6.0.0 IK分词 Kibana 6.0.0
生活随笔
收集整理的這篇文章主要介紹了
ElasticSearch 6.0.0 IK分词 Kibana 6.0.0
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
ElasticSearch 6.0.0 & IK分詞 & Kibana 6.0.0
1. 安裝ES 6.0.0
docker run -itd -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" --name=elasticsearch docker.elastic.co/elasticsearch/elasticsearch:6.0.02. 安裝Kibana 6.0.0
docker run -dit -p 5601:5601 --name=kibana --link elasticsearch:elasticsearch docker.elastic.co/kibana/kibana:6.0.03. 安裝 ik 插件
elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.0.0/elasticsearch-analysis-ik-6.0.0.zip4. 重啟ES
5. 創建索引
curl -XPUT http://localhost:9200/index6.設置映射
curl -XPOST http://localhost:9200/index/fulltext/_mapping -d' {"properties": {"content": {"type": "text","analyzer": "ik_max_word","search_analyzer": "ik_max_word","term_vector": "with_positions_offsets","fielddata" : true}} }'7.插入數據
curl -XPOST http://localhost:9200/index/fulltext/1 -d' {"content":"美國留給伊拉克的是個爛攤子嗎" }'8.查詢
GET /index/fulltext/_search {"size" : 0,"query": {"term": {"_id": {"value": "2"}}}, "aggs" : { "cipin" : { "terms" : { "size": 100, "field" : "content","include" : "本職工作|財務管理"}}} } 《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的ElasticSearch 6.0.0 IK分词 Kibana 6.0.0的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: redis 实际应用中的缓存作用
- 下一篇: 将军令:数据安全平台建设实践