Mercurial > public > sg101
comparison gpp/weblinks/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 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 weblinks.models import Link | 6 from weblinks.models import Link |
6 | 7 |
7 | 8 |
8 class LinkIndex(SearchIndex): | 9 class LinkIndex(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='date_added') | 12 pub_date = DateTimeField(model_attr='date_added') |
12 | 13 |
13 def get_queryset(self): | 14 def get_queryset(self): |