forked from MarseyWorld/MarseyWorld
Comments search: utilize lexeme config.
parent
d28281bf8f
commit
216022a5a0
|
@ -207,8 +207,9 @@ def searchcomments(v):
|
||||||
else: comments = comments.filter(Comment.author_id == author.id)
|
else: comments = comments.filter(Comment.author_id == author.id)
|
||||||
|
|
||||||
if 'q' in criteria:
|
if 'q' in criteria:
|
||||||
comments = comments.filter(Comment.body_ts.op('@@')(
|
comments = comments.filter(Comment.body_ts.match(
|
||||||
func.plainto_tsquery(' & '.join(criteria['q']))))
|
' & '.join(criteria['q']),
|
||||||
|
postgresql_regconfig='english'))
|
||||||
|
|
||||||
if 'over18' in criteria: comments = comments.filter(Comment.over_18 == True)
|
if 'over18' in criteria: comments = comments.filter(Comment.over_18 == True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue