Add total hits to output

This commit is contained in:
2023-02-01 07:20:24 +00:00
parent 53cb9a7f76
commit 66596cda42
4 changed files with 18 additions and 6 deletions

View File

@@ -125,6 +125,8 @@ def parse_results(results, meta=None):
for field in ["avg_sentiment"]: # Add other number fields here
if field in results["aggregations"]:
meta["aggs"][field] = results["aggregations"][field]
total_hits = results["hits"]["total"]["value"]
meta["total_hits"] = total_hits
return (meta, results_parsed)
return results_parsed