# HG changeset patch # User Brian Neal # Date 1300845764 0 # Node ID 79240675b903497c5f05b70eed506a706546b99c # Parent 0398aae488079191b96510d011383944abdf920a For #178; using the queued_search app to update the search index. Installed redis and dependencies. diff -r 0398aae48807 -r 79240675b903 gpp/bio/search_indexes.py --- a/gpp/bio/search_indexes.py Wed Mar 23 00:44:06 2011 +0000 +++ b/gpp/bio/search_indexes.py Wed Mar 23 02:02:44 2011 +0000 @@ -1,11 +1,12 @@ """Haystack search index for the bio application.""" from haystack.indexes import * from haystack import site +from queued_search.indexes import QueuedSearchIndex from bio.models import UserProfile -class UserProfileIndex(SearchIndex): +class UserProfileIndex(QueuedSearchIndex): text = CharField(document=True, use_template=True) author = CharField(model_attr='user') diff -r 0398aae48807 -r 79240675b903 gpp/downloads/search_indexes.py --- a/gpp/downloads/search_indexes.py Wed Mar 23 00:44:06 2011 +0000 +++ b/gpp/downloads/search_indexes.py Wed Mar 23 02:02:44 2011 +0000 @@ -1,11 +1,12 @@ """Haystack search index for the downloads application.""" from haystack.indexes import * from haystack import site +from queued_search.indexes import QueuedSearchIndex from downloads.models import Download -class DownloadIndex(SearchIndex): +class DownloadIndex(QueuedSearchIndex): text = CharField(document=True, use_template=True) author = CharField(model_attr='user') pub_date = DateTimeField(model_attr='date_added') diff -r 0398aae48807 -r 79240675b903 gpp/forums/search_indexes.py --- a/gpp/forums/search_indexes.py Wed Mar 23 00:44:06 2011 +0000 +++ b/gpp/forums/search_indexes.py Wed Mar 23 02:02:44 2011 +0000 @@ -1,11 +1,12 @@ """Haystack search index for the weblinks application.""" from haystack.indexes import * from haystack import site +from queued_search.indexes import QueuedSearchIndex from forums.models import Forum, Post -class PostIndex(SearchIndex): +class PostIndex(QueuedSearchIndex): text = CharField(document=True, use_template=True) author = CharField(model_attr='user') pub_date = DateTimeField(model_attr='creation_date') diff -r 0398aae48807 -r 79240675b903 gpp/news/search_indexes.py --- a/gpp/news/search_indexes.py Wed Mar 23 00:44:06 2011 +0000 +++ b/gpp/news/search_indexes.py Wed Mar 23 02:02:44 2011 +0000 @@ -1,10 +1,12 @@ """Haystack search index for the news application.""" from haystack.indexes import * from haystack import site +from queued_search.indexes import QueuedSearchIndex + from news.models import Story -class StoryIndex(SearchIndex): +class StoryIndex(QueuedSearchIndex): text = CharField(document=True, use_template=True) author = CharField(model_attr='submitter') pub_date = DateTimeField(model_attr='date_submitted') diff -r 0398aae48807 -r 79240675b903 gpp/podcast/search_indexes.py --- a/gpp/podcast/search_indexes.py Wed Mar 23 00:44:06 2011 +0000 +++ b/gpp/podcast/search_indexes.py Wed Mar 23 02:02:44 2011 +0000 @@ -1,10 +1,12 @@ """Haystack search index for the news application.""" from haystack.indexes import * from haystack import site +from queued_search.indexes import QueuedSearchIndex + from podcast.models import Item -class ItemIndex(SearchIndex): +class ItemIndex(QueuedSearchIndex): text = CharField(document=True, use_template=True) author = CharField(model_attr='author') pub_date = DateTimeField(model_attr='pubdate') diff -r 0398aae48807 -r 79240675b903 gpp/settings.py --- a/gpp/settings.py Wed Mar 23 00:44:06 2011 +0000 +++ b/gpp/settings.py Wed Mar 23 02:02:44 2011 +0000 @@ -134,6 +134,7 @@ 'elsewhere', 'tagging', 'haystack', + 'queued_search', 'accounts', 'antispam', 'bio', @@ -265,6 +266,13 @@ DEBUG_TOOLBAR_CONFIG = local_settings.DEBUG_TOOLBAR_CONFIG ####################################################################### +# Asynchronous settings (queues, queued_search, redis, celery, etc) +####################################################################### +QUEUE_BACKEND = 'redisd' +QUEUE_REDIS_CONNECTION = 'localhost:6379' +QUEUE_REDIS_DB = 0 + +####################################################################### # URL's of 3rd party Javascript and CSS files. # These dictionaries are used by core/templatetags/script_tags, and # should also be used by developers when creating form media classes. diff -r 0398aae48807 -r 79240675b903 gpp/weblinks/search_indexes.py --- a/gpp/weblinks/search_indexes.py Wed Mar 23 00:44:06 2011 +0000 +++ b/gpp/weblinks/search_indexes.py Wed Mar 23 02:02:44 2011 +0000 @@ -1,11 +1,12 @@ """Haystack search index for the weblinks application.""" from haystack.indexes import * from haystack import site +from queued_search.indexes import QueuedSearchIndex from weblinks.models import Link -class LinkIndex(SearchIndex): +class LinkIndex(QueuedSearchIndex): text = CharField(document=True, use_template=True) author = CharField(model_attr='user') pub_date = DateTimeField(model_attr='date_added') diff -r 0398aae48807 -r 79240675b903 gpp/ygroup/search_indexes.py --- a/gpp/ygroup/search_indexes.py Wed Mar 23 00:44:06 2011 +0000 +++ b/gpp/ygroup/search_indexes.py Wed Mar 23 02:02:44 2011 +0000 @@ -4,11 +4,12 @@ """ from haystack.indexes import * from haystack import site +from queued_search.indexes import QueuedSearchIndex from ygroup.models import Post -class PostIndex(SearchIndex): +class PostIndex(QueuedSearchIndex): text = CharField(document=True, use_template=True) pub_date = DateTimeField(model_attr='creation_date')