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

后端 未结 1 852
一整个雨季
一整个雨季 2021-01-14 19:16

Edit: More info at bottom of post...

Original Question:

I seem to be having the same problem as in this (unresolved) question: django-haysta

相关标签:
1条回答
  • 2021-01-14 19:49

    It looks like this a bug in haystack that has already been reported but has yet to be addressed:

    https://github.com/django-haystack/django-haystack/issues/1021

    Unfortunately if the "text" index field is Ngram or EdgeNgram SearchQuerySet().count() and SearchQuerySet().all().count() will return 0 unless you specify a filter, e.g. SearchQuerySet().all().exclude(content='thisshouldnotmatchanythingintheindex').count() returns the total number of indexed objects.

    0 讨论(0)
提交回复
热议问题