Commit 6f0a811e by christopher lee

cache

parent bfc6c810
from course_discovery.apps.api.v1.views.search import AggregateSearchViewSet
from course_discovery.apps.edx_catalog_extensions.api.serializers import DistinctCountsAggregateFacetSearchSerializer
from course_discovery.apps.edx_haystack_extensions.distinct_counts.query import DistinctCountsSearchQuerySet
from functools import lru_cache
class DistinctCountsAggregateSearchViewSet(AggregateSearchViewSet):
......@@ -9,6 +10,7 @@ class DistinctCountsAggregateSearchViewSet(AggregateSearchViewSet):
# Custom serializer that includes distinct hit and facet counts.
facet_serializer_class = DistinctCountsAggregateFacetSearchSerializer
@lru_cache(maxsize=None)
def get_queryset(self, *args, **kwargs): # pylint: disable=arguments-differ
""" Return the base Queryset to use to build up the search query."""
queryset = super(DistinctCountsAggregateSearchViewSet, self).get_queryset(*args, **kwargs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment