elasticsearch.py 文件源码

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

项目:pandachaika 作者: pandabuilder 项目源码 文件源码
def prepare_facet_data(self, aggregations: AggResponse, get_args: QueryDict) -> Dict[str, List[Dict[str, str]]]:
        resp: DataDict = {}
        for area, agg in aggregations.to_dict().items():
            resp[area] = []
            for item in aggregations[area].buckets:
                url_args, is_active = self.facet_url_args(
                    url_args=deepcopy(get_args.dict()),
                    field_name=area,
                    field_value=str(item.key)
                )
                resp[area].append({
                    'url_args': urlencode(url_args),
                    'name': item.key,
                    'count': item.doc_count,
                    'is_active': is_active
                })
        return resp
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号