What kind of query should I look at to get, groupe...
# community-help
c
What kind of query should I look at to get, grouped on a specific field, the min/max and count for a given value?
k
You have to use facet _by
🙏 1
c
one followup if you don't mind. Facets and summaries seem to be always done on the full result set, not on the grouping itself. But maybe grouping is not what I'm looking for in the first place. I have 15k records, which have a field "owner" which has ~ 1000 distinct values. I want the top 1, grouped by this owner, and then get the facet values based on this, but from what I read here: https://threads.typesense.org/kb/t/grouping-and-aggregation-in-typesense/2K62a0 facets are always running before grouping, not after. Is there a way to get faceted search running on the grouped resultset? (or an alternative way to do this)
k
That answer is a bit misleading. The facets are calculated on the whole set but the faceting takes grouping into account. So for e.g. if there are N groups containing K records the counts will be tracking N and not K. Maybe it it's not working as expected maybe you can show an example with just 4-5 example records.