drf-haystack
drf-haystack copied to clipboard
Facet query not working
I am unable to use facets when trying narrow urls.
Default search page with no query works and it displays facets options but facet queries via narrow url don't work
django-haystack -2.60 drf-haystack==1.6.1
@chirag7jain I'm having the same issue. Did you manage to figure out what the problem was?
If anyone else ends up here: I'm pretty sure I solved this by not using FacetCharField()
but CharField(faceted=True)
instead.
@vonorm no luck
Leaving an answer here because this same thing happened to me.
In the documentation that walks you through setting up your ViewSet
, it mentions HaystackFacetFilter:
facet_filter_backends = [HaystackFacetFilter] # This is the default facet filter, and
# can be left out.
That comment doesn't seem to be true. If you leave that out, your facet filters won't work. You have to add HaystackFacetFilter
. Adding that fixed this issue for me.