comparison gpp/ygroup/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 0c18dfb1da1c
children b910cc1460c8
comparison
equal deleted inserted replaced
391:0398aae48807 392:79240675b903
2 Haystack search index for the Yahoo Group archives application. 2 Haystack search index for the Yahoo Group archives application.
3 3
4 """ 4 """
5 from haystack.indexes import * 5 from haystack.indexes import *
6 from haystack import site 6 from haystack import site
7 from queued_search.indexes import QueuedSearchIndex
7 8
8 from ygroup.models import Post 9 from ygroup.models import Post
9 10
10 11
11 class PostIndex(SearchIndex): 12 class PostIndex(QueuedSearchIndex):
12 text = CharField(document=True, use_template=True) 13 text = CharField(document=True, use_template=True)
13 pub_date = DateTimeField(model_attr='creation_date') 14 pub_date = DateTimeField(model_attr='creation_date')
14 15
15 def get_updated_field(self): 16 def get_updated_field(self):
16 return 'creation_date' 17 return 'creation_date'