fix find_results through SearchProcess
This commit is contained in:
parent
1cdb9e1ad5
commit
7801ed0d60
|
@ -200,11 +200,12 @@ class ArchivistResultsView(ArchivistViewConfig):
|
||||||
def find_results(self):
|
def find_results(self):
|
||||||
"""add results and pagination to context"""
|
"""add results and pagination to context"""
|
||||||
response, _ = ElasticWrap(self.es_search).get(self.data)
|
response, _ = ElasticWrap(self.es_search).get(self.data)
|
||||||
|
results = SearchProcess(response).process()
|
||||||
max_hits = response["hits"]["total"]["value"]
|
max_hits = response["hits"]["total"]["value"]
|
||||||
self.pagination_handler.validate(max_hits)
|
self.pagination_handler.validate(max_hits)
|
||||||
self.context.update(
|
self.context.update(
|
||||||
{
|
{
|
||||||
"results": [i["_source"] for i in response["hits"]["hits"]],
|
"results": results,
|
||||||
"max_hits": max_hits,
|
"max_hits": max_hits,
|
||||||
"pagination": self.pagination_handler.pagination,
|
"pagination": self.pagination_handler.pagination,
|
||||||
"aggs": response.get("aggregations"),
|
"aggs": response.get("aggregations"),
|
||||||
|
|
Loading…
Reference in New Issue