diff options
author | Tomasz Zielinski <tomasz.zielinski@pyconsultant.eu> | 2012-01-24 19:16:17 +0100 |
---|---|---|
committer | Tomasz Zielinski <tomasz.zielinski@pyconsultant.eu> | 2012-01-24 19:16:17 +0100 |
commit | eb765ca1625f1c82bf8b8e51c26a656c43255204 (patch) | |
tree | 57223967430a98f31af1b7fc689d59ddde7df877 | |
parent | 6c6f43a4e5339aded1b8b1ae921411cb00c71e84 (diff) | |
download | askbot-eb765ca1625f1c82bf8b8e51c26a656c43255204.tar.gz askbot-eb765ca1625f1c82bf8b8e51c26a656c43255204.tar.bz2 askbot-eb765ca1625f1c82bf8b8e51c26a656c43255204.zip |
Search bugfix done + reverted accidential commit of timing code
-rw-r--r-- | askbot/models/question.py | 4 | ||||
-rw-r--r-- | askbot/views/readers.py | 9 |
2 files changed, 3 insertions, 10 deletions
diff --git a/askbot/models/question.py b/askbot/models/question.py index 184e8813..6c2fa383 100644 --- a/askbot/models/question.py +++ b/askbot/models/question.py @@ -116,12 +116,12 @@ class ThreadManager(models.Manager): models.Q(posts__deleted=False, posts__text__search = search_query) ) elif 'postgresql_psycopg2' in askbot.get_database_engine_name(): - rank_clause = "ts_rank(text_search_vector, plainto_tsquery(%s))" + rank_clause = "ts_rank(askbot_thread.text_search_vector, plainto_tsquery(%s))" search_query = '&'.join(search_query.split()) extra_params = (search_query,) extra_kwargs = { 'select': {'relevance': rank_clause}, - 'where': ['text_search_vector @@ plainto_tsquery(%s)'], + 'where': ['askbot_thread.text_search_vector @@ plainto_tsquery(%s)'], 'params': extra_params, 'select_params': extra_params, } diff --git a/askbot/views/readers.py b/askbot/views/readers.py index e034533c..cccfce67 100644 --- a/askbot/views/readers.py +++ b/askbot/views/readers.py @@ -69,9 +69,6 @@ def questions(request, **kwargs): List of Questions, Tagged questions, and Unanswered questions. matching search query or user selection """ - import time - start = time.time() - if request.method != 'GET': return HttpResponseNotAllowed(['GET']) @@ -211,11 +208,7 @@ def questions(request, **kwargs): 'feed_url': context_feed_url, } - tstart = time.time() - ret = render_into_skin('main_page.html', template_data, request) - print "Jinja - elapsed:", time.time() - tstart - print "Elapsed:", time.time() - start - return ret + return render_into_skin('main_page.html', template_data, request) def tags(request):#view showing a listing of available tags - plain list |