documents.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:photo-manager 作者: karih 项目源码 文件源码
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 = esd.Q('match_all')
            for field, filter in iteritems(self._filters):
                if f == field or (f.startswith("date") and field.startswith("date")):
                    continue
                agg_filter &= filter
            search.aggs.bucket(
                '_filter_' + f,
                'filter',
                filter=agg_filter
            ).bucket(f, agg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号