Mercurial > public > sg101
comparison gpp/forums/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 | b1f939b1fb01 |
comparison
equal
deleted
inserted
replaced
391:0398aae48807 | 392:79240675b903 |
---|---|
1 """Haystack search index for the weblinks application.""" | 1 """Haystack search index for the weblinks 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 | |
4 | 5 |
5 from forums.models import Forum, Post | 6 from forums.models import Forum, Post |
6 | 7 |
7 | 8 |
8 class PostIndex(SearchIndex): | 9 class PostIndex(QueuedSearchIndex): |
9 text = CharField(document=True, use_template=True) | 10 text = CharField(document=True, use_template=True) |
10 author = CharField(model_attr='user') | 11 author = CharField(model_attr='user') |
11 pub_date = DateTimeField(model_attr='creation_date') | 12 pub_date = DateTimeField(model_attr='creation_date') |
12 | 13 |
13 def get_queryset(self): | 14 def get_queryset(self): |