Skip to content Skip to sidebar Skip to footer

Django-haystack + Whoosh Searchqueryset().all() Always None

I am using: django: 1.9.7 django-haystack: 2.5.0 whoosh: 2.7.4 search_index.py class ProfileIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document

Solution 1:

Please see my answer here:

Django Haystack & Whoosh Search Working, But SearchQuerySet Return 0 Results

There is a bug in Django-Haystack with Woosh that means if you use an Ngram or EdgeNGram field SearchQuerySet().count() and SearchQuerySet().all().count() will always return 0 unless you specify a filter.

e.g.

SearchQuerySet().all().count()
>> 0SearchQuerySet().all().exclude(content='thisshouldnotmatchanything').count()
>> 14[the total number of indexed objects]

Post a Comment for "Django-haystack + Whoosh Searchqueryset().all() Always None"