comparison gpp/news/search_indexes.py @ 392:79240675b903

For #178; using the queued_search app to update the search index. Installed redis and dependencies.
author Brian Neal <bgneal@gmail.com>
date Wed, 23 Mar 2011 02:02:44 +0000
parents d424b8bae71d
children b910cc1460c8
comparison
equal deleted inserted replaced
391:0398aae48807 392:79240675b903
1 """Haystack search index for the news application.""" 1 """Haystack search index for the news application."""
2 from haystack.indexes import * 2 from haystack.indexes import *
3 from haystack import site 3 from haystack import site
4 from queued_search.indexes import QueuedSearchIndex
5
4 from news.models import Story 6 from news.models import Story
5 7
6 8
7 class StoryIndex(SearchIndex): 9 class StoryIndex(QueuedSearchIndex):
8 text = CharField(document=True, use_template=True) 10 text = CharField(document=True, use_template=True)
9 author = CharField(model_attr='submitter') 11 author = CharField(model_attr='submitter')
10 pub_date = DateTimeField(model_attr='date_submitted') 12 pub_date = DateTimeField(model_attr='date_submitted')
11 13
12 def get_updated_field(self): 14 def get_updated_field(self):