drf-haystack icon indicating copy to clipboard operation
drf-haystack copied to clipboard

Facet query not working

Open chirag7jain opened this issue 7 years ago • 4 comments

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 avatar May 02 '17 18:05 chirag7jain

@chirag7jain I'm having the same issue. Did you manage to figure out what the problem was?

bentappin avatar Jun 12 '18 13:06 bentappin

If anyone else ends up here: I'm pretty sure I solved this by not using FacetCharField() but CharField(faceted=True) instead.

bentappin avatar Jun 12 '18 16:06 bentappin

@vonorm no luck

chirag7jain avatar Jun 13 '18 19:06 chirag7jain

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.

gulci avatar Jun 03 '19 16:06 gulci