<commit_before>import datetime
from haystack import indexes
from lobbyingph.models import Principal, Firm, Lobbyist

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

    def get_model(self):
        return Principal

    def index_queryset(self):
        """Used when the entire index for model is updated."""
        return self.get_model().objects.all()

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

    def get_model(self):
        return Firm

    def index_queryset(self):
        """Used when the entire index for model is updated."""
        return self.get_model().objects.all()

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

    def get_model(self):
        return Lobbyist

    def index_queryset(self):
        """Used when the entire index for model is updated."""
        return self.get_model().objects.all()<commit_msg>experimenting with haystack search indexes to fix heroku<commit_after>import datetime
from haystack import indexes
from lobbyingph.models import Principal, Firm, Lobbyist

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

    def get_model(self):
        return Principal

    def index_queryset(self):
        """Used when the entire index for model is updated."""
        return self.get_model().objects.all()

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

    def get_model(self):
        return Firm

    def index_queryset(self):
        """Used when the entire index for model is updated."""
        return self.get_model().objects.all()

{'fraction_non_alphanumeric': 0.10090433127082342, 'fraction_numerical': 0.0, 'mean_word_length': 3.9692671394799053, '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': '482201', 'n_tokens_mistral': 619, 'n_tokens_neox': 576, 'n_words': 155}