MCPcopy Create free account
hub / github.com/alephdata/aleph / __init__

Method __init__

aleph/search/result.py:98–111  ·  view source on GitHub ↗
(self, request, query)

Source from the content-addressed store, hash-verified

96 }
97
98 def __init__(self, request, query):
99 super(SearchQueryResult, self).__init__(request, parser=query.parser)
100 self.query = query
101 result = query.search()
102 hits = result.get("hits", {})
103 total = hits.get("total", {})
104 self.total = total.get("value")
105 self.total_type = total.get("relation")
106 self.aggregations = result.get("aggregations")
107 for doc in hits.get("hits", []):
108 # log.info("Res: %s", pformat(doc))
109 doc = unpack_result(doc)
110 if doc is not None:
111 self.results.append(doc)
112
113 def get_facets(self):
114 facets = {}

Callers

nothing calls this directly

Calls 4

unpack_resultFunction · 0.90
searchMethod · 0.80
__init__Method · 0.45
getMethod · 0.45

Tested by

no test coverage detected