This commit is contained in:
2025-03-20 21:26:04 -03:00
parent 85cbc9269c
commit 1f19380f5c
20 changed files with 293 additions and 54 deletions

View File

@@ -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],
}