1 from forum.models.question import Question, QuestionManager
2 from forum.modules.decorators import decorate
4 @decorate(QuestionManager.search, needs_origin=False)
5 def question_search(self, keywords):
7 tables=['forum_rootnode_doc'],
9 'ranking': 'ts_rank_cd(\'{0.1, 0.2, 0.8, 1.0}\'::float4[], "forum_rootnode_doc"."document", plainto_tsquery(\'english\', %s), 32)',
11 where=['"forum_rootnode_doc"."node_id" = "forum_node"."id"', '"forum_rootnode_doc"."document" @@ plainto_tsquery(\'english\', %s)'],
13 select_params=[keywords],