]> git.openstreetmap.org Git - osqa.git/blob - forum_modules/pgfulltext/handlers.py
improved FTS. make fts indexes update faster and take the load out of the node table.
[osqa.git] / forum_modules / pgfulltext / handlers.py
1 from forum.models import Question
2
3 def question_search(keywords):
4     return Question.objects.extra(
5                     select={
6                         'ranking': "node_ranking(id, %s)",
7                     },
8                     where=["node_ranking(id, %s) > 0"],
9                     params=[keywords],
10                     select_params=[keywords]
11                 ).order_by('-ranking')