code: def aggregate(self, search):
          
          for f, facet in self.facets.items():
              agg = facet.get_aggregation()
              if isinstance(agg, Bucket):
                  search.aggs.bucket(f, agg)
              elif isinstance(agg, Pipeline):
                  search.aggs.pipeline(f, agg)
              else:
                  search.aggs.metric(f, agg)
docs: Add aggregations representing the facets selected