?
elastic search head 基本用法
?
es 安装方法:?http://knight-black-bob.iteye.com/blog/2259836
?
?
?
?
资源监控和集群管理插件?
?
bin/plugin -install lukas-vlcek/bigdesk http://192.168.13.140:9200/_plugin/bigdesk
?
?数据查询插件
?
bin/plugin -install mobz/elasticsearch-head http://192.168.13.140:9200/_plugin/head/
?
?
理解性:
? ?_index ?类似 mysql中 database
? ?_type ? 类似 ?mysql 中 table
? ?_ id ? ? 类似 ?mysql 中 id
?
?
插入测试数据
使用 put ??http://192.168.13.140:9200/baoyou/10120/17_2/
?{
? "token_id": 17,
? "type_id": 1,
? "tag_desc": "test data",
? "insert_time": "20151202",
? "tag_id": 2
}
使用 put ??http://192.168.13.140:9200/baoyou/10120/17_1/
?{
? "token_id": 17,
? "type_id": 1,
? "tag_desc": "test data",
? "insert_time": "20151202",
? "tag_id": 1
}
?
?
?
2.删除数据
?
?
3.查询语句
?
{ "size": 5, "query": { "bool": { "should": [ { "match": { "tag_id": 2 } }, { "match": { "tag_id": 1 } } ] } }, "aggs": { "hello": { "terms": { "field": "token_id" } } } }
?
?
?
4.更新数据
?
?
更新数据 version 有所改变
?
?
?
?
?
?
?
?
原文:http://knight-black-bob.iteye.com/blog/2262586