<commit_before>from haystack import indexes
from .models import Discussion, Post


class DiscussionIndex(indexes.SearchIndex, indexes.Indexable):
    title = indexes.CharField(model_attr='name')
    text = indexes.CharField(document=True, use_template=True)

    def get_model(self):
        return Discussion

    def index_queryset(self):
        return self.get_model().objects.all()


class PostIndex(indexes.SearchIndex, indexes.Indexable):
    title = indexes.CharField(use_template=True)
    text = indexes.CharField(document=True, use_template=True)

    def get_model(self):
        return Post

    def index_queryset(self):
        return self.get_model().objects.all()<commit_msg>fixed missing kwarg using in search_indexes for haystack >=2<commit_after>from haystack import indexes
from .models import Discussion, Post


class DiscussionIndex(indexes.SearchIndex, indexes.Indexable):
    title = indexes.CharField(model_attr='name')
    text = indexes.CharField(document=True, use_template=True)

    def get_model(self):
        return Discussion

    def index_queryset(self, using=None):
        return self.get_model().objects.all()


class PostIndex(indexes.SearchIndex, indexes.Indexable):
    title = indexes.CharField(use_template=True)
    text = indexes.CharField(document=True, use_template=True)

    def get_model(self):
        return Post

    def index_queryset(self, using=None):
        return self.get_model().objects.all()
{'fraction_non_alphanumeric': 0.09896907216494845, 'fraction_numerical': 0.0006872852233676976, 'mean_word_length': 4.333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2733622', 'n_tokens_mistral': 445, 'n_tokens_neox': 412, 'n_words': 91}