你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
没有找到相关结果
rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk
赞同来自: lzc 、cccthought
GET cars/_search { "size": 0, "aggs": { "colors": { "terms": { "field": "color" }, "aggs": { "avg_price": { "avg": { "field": "price" } }, "bucket_filter": { "bucket_selector": { "buckets_path": { "avgPrice": "avg_price" }, "script": "params.avgPrice>4000" } } } } } }
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: lzc
POST book_authors/_search { "query":{ "terms":{ "authors": ["张三"] } }, "size": 0, "aggs" : { "authors_agg": { "terms": { "field": "authors" }, "aggs": { "count_bucket_filter": { "bucket_selector": { "buckets_path": { "cur_doc_cnt": "_count" }, "script": "params.cur_doc_cnt > 5" } } } } } }
yayg2008
赞同来自:
lzc
要回复问题请先登录或注册
4 个回复
rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk
赞同来自: lzc 、cccthought
你的需求用 pipeline aggregation 中的 bucket selector 可以实现,看下官方的例子好了
https://www.elastic.co/guide/e ... .html
我还是补一下例子吧……
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: lzc
yayg2008
赞同来自:
lzc
赞同来自: