-
Notifications
You must be signed in to change notification settings - Fork 89
iamazy edited this page Sep 17, 2019
·
3 revisions
select max(age),count(distinct name),max(height) from student group by name,age,height
目前实现的聚类方法有
sum
max
min
cardinality
terms
top_hits
以上聚类方法单独使用为
select * from apple aggregate by terms(productName,10)
select * from apple aggregate by cardinality(productName)
select * from apple aggregate by top_hits(10)
elasticsearch-sql 使用>
表示sub-aggs
,使用,
隔开aggs
select * from apple aggregate by terms(productName,10)>(terms(provider,10)),cardinality(provider)
---如果聚类较多请用括号括起来
select * from apple aggregate by terms(productName,10)>(terms(provider,10),cardinality(provider))
select * from apple aggregate by [apple,terms(apple.color,2)];