Skip to content

Commit

Permalink
Read hits.total.value to get number of hits (#15728)
Browse files Browse the repository at this point in the history
This should fix test_management.py under Python3. An object was being returned but
the test was expecting to get a number. The format of the Elasticsearch response changed
for the "track_total_hits" enhancement, but this wasn't updated.
  • Loading branch information
andrewkroh authored Jan 22, 2020
1 parent d037668 commit 1ceabf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/libbeat/tests/system/test_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def random_index(self):
def check_document_count(self, index, count):
try:
self.es.indices.refresh(index=index)
return self.es.search(index=index, body={"query": {"match_all": {}}})['hits']['total'] >= count
return self.es.search(index=index, body={"query": {"match_all": {}}})['hits']['total']['value'] >= count
except:
return False

Expand Down

0 comments on commit 1ceabf0

Please sign in to comment.