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