@list_route(methods=["get"], url_path="facets")
    def facets(self, request):
        queryset = self.filter_facet_queryset(self.get_queryset())

        for facet in request.GET.getlist("selected_facets"):

            if ":" not in facet:
                continue

            field, value = facet.split(":", 1)
            if value:
                queryset = queryset.narrow('%s:"%s"' % (field, queryset.query.clean(value)))

        page = self.paginate_queryset(queryset)
        if page is not None:
            serializer = self.get_facet_serializer(queryset.facet_counts(), objects=page, many=False)
            return Response(serializer.data)

        serializer = self.get_facet_serializer(queryset.facet_counts(), objects=queryset, many=False)
        return Response(serializer.data)
Sets up a list route for ``faceted`` results.
dataset/ETHPy150Open inonit/drf-haystack/drf_haystack/viewsets.py/HaystackViewSet.facets