Mercurial > public > sg101
comparison gpp/bio/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 bio application.""" | 1 """Haystack search index for the bio 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 bio.models import UserProfile | 6 from bio.models import UserProfile |
6 | 7 |
7 | 8 |
8 class UserProfileIndex(SearchIndex): | 9 class UserProfileIndex(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 | 12 |
12 def get_queryset(self): | 13 def get_queryset(self): |
13 return UserProfile.objects.filter(user__is_active=True) | 14 return UserProfile.objects.filter(user__is_active=True) |