<commit_before># -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals

from rest_framework.pagination import PageNumberPagination

from drf_haystack.filters import HaystackBoostFilter, HaystackHighlightFilter, HaystackAutocompleteFilter, HaystackGEOSpatialFilter
from drf_haystack.viewsets import HaystackViewSet

from .models import MockPerson, MockLocation
from .serializers import (
    SearchSerializer, HighlighterSerializer,
    MoreLikeThisSerializer, MockPersonFacetSerializer
)


class BasicPagination(PageNumberPagination):
    page_size = 2
    page_size_query_param = "page_size"


class SearchViewSet1(HaystackViewSet):
    index_models = [MockPerson]
    serializer_class = SearchSerializer
    filter_backends = [HaystackHighlightFilter, HaystackAutocompleteFilter]

    # Faceting
    facet_serializer_class = MockPersonFacetSerializer
    pagination_class = BasicPagination


class SearchViewSet2(HaystackViewSet):
    index_models = [MockLocation]
    serializer_class = HighlighterSerializer
    filter_backends = [HaystackGEOSpatialFilter]


class SearchViewSet3(HaystackViewSet):
    index_models = [MockPerson]
    serializer_class = MoreLikeThisSerializer<commit_msg>Updated local test views<commit_after># -*- coding: utf-8 -*-

from __future__ import absolute_import, unicode_literals

from rest_framework.pagination import PageNumberPagination

from drf_haystack.filters import HaystackFilter, HaystackBoostFilter, HaystackHighlightFilter, HaystackAutocompleteFilter, HaystackGEOSpatialFilter
from drf_haystack.viewsets import HaystackViewSet

from .models import MockPerson, MockLocation
from .serializers import (
    SearchSerializer, HighlighterSerializer,
    MoreLikeThisSerializer, MockPersonFacetSerializer
)


class BasicPagination(PageNumberPagination):
    page_size = 20
    page_size_query_param = "page_size"


class SearchViewSet1(HaystackViewSet):
    index_models = [MockPerson]
    serializer_class = SearchSerializer
    filter_backends = [HaystackFilter, HaystackBoostFilter]

    # Faceting
    facet_serializer_class = MockPersonFacetSerializer
    pagination_class = BasicPagination


class SearchViewSet2(HaystackViewSet):
    index_models = [MockLocation]
    serializer_class = HighlighterSerializer
    filter_backends = [HaystackBoostFilter]


class SearchViewSet3(HaystackViewSet):
    index_models = [MockPerson]
    serializer_class = MoreLikeThisSerializer
{'fraction_non_alphanumeric': 0.05366653011061041, 'fraction_numerical': 0.004506349856616141, 'mean_word_length': 6.161290322580645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6164251', 'n_tokens_mistral': 712, 'n_tokens_neox': 684, 'n_words': 141}