(self, search)
Add aggregations representing the facets selected, including potential
        filters.
Add aggregations representing the facets selected, including potential
        filters.
Add aggregations representing the facets selected including potential filters .
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)
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 )