S
S
s7fkcu2019-02-07 13:14:26
Django
s7fkcu, 2019-02-07 13:14:26

Faceted search not working, whoosh + haystack?

Good afternoon. I made a bunch of whoosh + haystack, faceted search does not work.
In the file search_indexes.py I write:

from haystack import indexes
from product.models import Blog

class BlogIndex(indexes.SearchIndex, indexes.Indexable):
    text = indexes.EdgeNgramField(document=True, use_template=True,
                                  template_name='search/indexes/blog/blog_text.txt')
    title = indexes.CharField(model_attr='title', faceted=True)
    author= indexes.CharField(model_attr='author', faceted=True)

    def get_model(self):
        return Blog

    def index_queryset(self, using=None):
        return self.get_model().objects.all()

after I do an update of the index and in the console I type:
>>> from haystack.query import SearchQuerySet
>>> sqs = SearchQuerySet().facet('author')
>>> sqs.facet_counts()
{}

And in pycharm it gives this "Warning: Whoosh does not handle faceting.
return func(obj, query_string, *args, **kwargs)"
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alternativshik, 2019-02-07
@alternativshik

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question