vespa-engine / vespa

AI + Data, online. https://vespa.ai
https://vespa.ai
Apache License 2.0
5.74k stars 598 forks source link

[Feature Request] grouping on aggregators #8566

Open npersad opened 5 years ago

npersad commented 5 years ago

Origin of request: https://stackoverflow.com/questions/54772024/possible-to-bucket-on-count

Not sure how feasible this is, but it would be helpful to group/bucket (predefined<...>) by count() or other aggregators.
For example, below (doesn't work) I am attempting to count the number of occurrences with "field1" and then further attempting to group the results based on the number of occurrences of field1.

all(group(predefined(status, bucket["field1"] ) ) each(  
       all(group(predefined(count(), bucket[0,10>, bucket[11,20>)) each(
         output(count() as(count)
       )) 
     ))     
npersad commented 5 years ago

Notes: This is similar to "pipeline aggregations" that elastic search has https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline.html