From 216022a5a0e8cd3cc8ad28ab3025ceeb6f905ab4 Mon Sep 17 00:00:00 2001 From: TLSM Date: Sun, 2 Oct 2022 06:24:03 -0400 Subject: [PATCH] Comments search: utilize lexeme config. --- files/routes/search.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/routes/search.py b/files/routes/search.py index 5a0a652c7..c96925feb 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -207,8 +207,9 @@ def searchcomments(v): else: comments = comments.filter(Comment.author_id == author.id) if 'q' in criteria: - comments = comments.filter(Comment.body_ts.op('@@')( - func.plainto_tsquery(' & '.join(criteria['q'])))) + comments = comments.filter(Comment.body_ts.match( + ' & '.join(criteria['q']), + postgresql_regconfig='english')) if 'over18' in criteria: comments = comments.filter(Comment.over_18 == True)