bgneal@219: """Haystack search index for the news application.""" bgneal@753: from haystack import indexes bgneal@392: bgneal@219: from news.models import Story bgneal@219: bgneal@219: bgneal@753: class StoryIndex(indexes.SearchIndex, indexes.Indexable): bgneal@753: text = indexes.CharField(document=True, use_template=True) bgneal@753: author = indexes.CharField(model_attr='submitter') bgneal@753: pub_date = indexes.DateTimeField(model_attr='date_submitted') bgneal@753: bgneal@753: def get_model(self): bgneal@753: return Story bgneal@219: bgneal@277: def get_updated_field(self): bgneal@277: return 'update_date'