parameters: (self, search)
docstring: Add aggregations representing the facets selected, including potential
          filters.
docstring_summary: Add aggregations representing the facets selected, including potential
          filters.
docstring_tokens: Add aggregations representing the facets selected including potential filters .
function: def aggregate(self, search):
          """
          Add aggregations representing the facets selected, including potential
          filters.
          """
          for f, facet in iteritems(self.facets):
              agg = facet.get_aggregation()
              agg_filter = Q('match_all')
              for field, filter in iteritems(self._filters):
                  if f == field:
                      continue
                  agg_filter &= filter
              search.aggs.bucket(
                  '_filter_' + f,
                  'filter',
                  filter=agg_filter
              ).bucket(f, agg)
function_tokens: def aggregate ( self , search ) : for f , facet in iteritems ( self . facets ) : agg = facet . get_aggregation ( ) agg_filter = Q ( 'match_all' ) for field , filter in iteritems ( self . _filters ) : if f == field : continue agg_filter &= filter search . aggs . bucket ( '_filter_' + f , 'filter' , filter = agg_filter ) . bucket ( f , agg )