Created
September 22, 2012 15:58
-
-
Save kezabelle/3766607 to your computer and use it in GitHub Desktop.
WTF Haystack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> # Why does applying a list of models increase the number of results | |
>>> # when that list of models accounts for all search indexes? | |
>>> from haystack.query import SearchQuerySet | |
>>> from haystack.forms import model_choices | |
>>> from django.db.models import get_model | |
>>> models = [get_model(*x[0].split('.')) for x in model_choices()] | |
>>> len(models) | |
6 | |
>>> sqs = SearchQuerySet() | |
>>> sqs.count() | |
1290 | |
>>> sqs.models(*models).count() | |
46342 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment