你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: chenzilong444 、lbx6z
PUT doc_index { "mappings": { "doc": { "properties":{ "doc_id":{"type":"long"}, "sed_id":{"type":"long"}, "sed_staus":{"type":"keyword"}, "op_times":{"type":"date"} } } } } put doc_index/doc/1 { "doc_id":1, "sed_id":5728, "sed_staus":"leave", "op_times":"2018-03-30T17:15Z" } GET doc_index/_mapping put doc_index/doc/2 { "doc_id":2, "sed_id":5728, "sed_status":"sucess", "op_times":"2018-03-29T03:52Z" } put doc_index/doc/3 { "doc_id":3, "sed_id":5728, "sed_status":"cancel", "op_times":"2018-03-31T23:08Z" } put doc_index/doc/4 { "doc_id":4, "sed_id":5729, "sed_status":"success", "op_times":"2018-03-31T23:08Z" } //取得最小 时间 POST doc_index/_search { "query":{ "term":{ "sed_id":5728 } }, "sort": [ { "op_times": "desc" } ], "aggs":{ "min_time":{ "min":{ "field": "op_times" } } }, "size":0 } //取得最大 时间 POST doc_index/_search { "query":{ "term":{ "sed_id":5728 } }, "sort": [ { "op_times": "desc" } ], "aggs":{ "max_time":{ "max":{ "field": "op_times" } } }, "size":0 }
strglee
赞同来自: lbx6z
GET doc_index/_search { "query":{ "match_all":{} }, "aggs": { "sed_terms": { "terms": { "field": "sed_id", "size": 1000 }, "aggs": { "min_time": { "min": { "field": "op_times" } }, "max_time": { "max": { "field": "op_times" } } } } } }
赞同来自:
qvitt
要回复问题请先登录或注册
4 个回复
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: chenzilong444 、lbx6z
strglee
赞同来自: lbx6z
strglee
赞同来自:
qvitt
赞同来自: