-@decorate(do_question_search, needs_origin=False)
-def question_search(keywords):
- return Question.objects.all().extra(
- tables=['forum_rootnode_doc'],
+@decorate(QuestionManager.search, needs_origin=False)
+def question_search(self, keywords):
+ repl_re = re.compile(r"[^\'\-_\s\w]", re.UNICODE)
+ tsquery = " | ".join([k for k in repl_re.sub('', keywords).split(' ') if k])
+ ilike = keywords + u"%%"
+
+ return self.extra(
+ tables = ['forum_rootnode_doc'],