Implement facets using groupBy operations