]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/pgfulltext/handlers.py
node absolute parent, tweaks in the activity log
[osqa.git] / forum_modules / pgfulltext / handlers.py
index 45ab2e781888d0118dfbde9457868e28fc73ebd1..4cac36f9ae2d6b42bba4a79961653e253f6995d5 100644 (file)
@@ -3,9 +3,9 @@ from forum.models import Question
 def question_search(keywords):
     return Question.objects.extra(
                     select={
-                        'ranking': "ts_rank_cd(tsv, plainto_tsquery(%s), 32)",
+                        'ranking': "node_ranking(id, %s)",
                     },
-                    where=["tsv @@ plainto_tsquery(%s)"],
+                    where=["node_ranking(id, %s) > 0"],
                     params=[keywords],
                     select_params=[keywords]
                 ).order_by('-ranking')
\ No newline at end of file