diff --git a/haystack/query.py b/haystack/query.py index 1be64658f..7b2e71076 100644 --- a/haystack/query.py +++ b/haystack/query.py @@ -86,7 +86,7 @@ def __len__(self): self._result_count = 0 # This needs to return the actual number of hits, not what's in the cache. - return self._result_count - self._ignored_result_count + return max(self._result_count - self._ignored_result_count, 0) def __iter__(self): if self._cache_is_full():