Skip to content

Commit

Permalink
Make hits optional (elastic#78)
Browse files Browse the repository at this point in the history
With this commit we ensure that statistics get still derived properly
even if there are no hits.
  • Loading branch information
danielmitterdorfer committed Jan 28, 2020
1 parent 822e046 commit 622d76f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eventdata/runners/kibana_runner.py
Expand Up @@ -56,7 +56,7 @@ def kibana(es, params):
sum_hits = 0
max_took = 0
for r in result["responses"]:
hits = r["hits"]["total"]
hits = r.get("hits", {}).get("total", 0)
if isinstance(hits, dict):
sum_hits += hits["value"]
else:
Expand Down

0 comments on commit 622d76f

Please sign in to comment.