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@219: title = CharField(use_template=True, indexed=False) bgneal@219: summary = CharField(use_template=True, indexed=False) bgneal@219: bgneal@219: bgneal@219: site.register(Story, StoryIndex)