wip
This commit is contained in:
@@ -28,13 +28,13 @@ def search(
|
||||
r = s.execute()
|
||||
except Exception:
|
||||
return {
|
||||
'total_hits': 0,
|
||||
'total_items': 0,
|
||||
'total_pages': 0,
|
||||
'hits': [],
|
||||
'items': [],
|
||||
}
|
||||
else:
|
||||
return {
|
||||
'total_hits': r.hits.total.value, # type: ignore
|
||||
'total_items': r.hits.total.value, # type: ignore
|
||||
'total_pages': math.ceil(r.hits.total.value / page_size), # type: ignore
|
||||
'hits': [hit.to_dict() for hit in r],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user