MCPcopy Index your code
hub / github.com/django-haystack/django-haystack / EmptySearchQuerySet

Class EmptySearchQuerySet

haystack/query.py:636–658  ·  view source on GitHub ↗

A stubbed SearchQuerySet that behaves as normal but always returns no results.

Source from the content-addressed store, hash-verified

634
635
636class EmptySearchQuerySet(SearchQuerySet):
637 """
638 A stubbed SearchQuerySet that behaves as normal but always returns no
639 results.
640 """
641
642 def __len__(self):
643 return 0
644
645 def _cache_is_full(self):
646 # Pretend the cache is always full with no results.
647 return True
648
649 def _clone(self, klass=None):
650 clone = super()._clone(klass=klass)
651 clone._result_cache = []
652 return clone
653
654 def _fill_cache(self, start, end):
655 return False
656
657 def facet_counts(self):
658 return {}
659
660
661class ValuesListSearchQuerySet(SearchQuerySet):

Callers 5

no_query_foundMethod · 0.90
SearchViewClass · 0.90
basic_searchFunction · 0.90
get_empty_query_setMethod · 0.90
setUpMethod · 0.90

Calls

no outgoing calls

Tested by 1

setUpMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…