search: fix tsquery when quoted unstripped space.

master
Snakes 2022-11-20 19:31:27 -05:00
parent d1078fb977
commit 44ef4bc551
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 1 additions and 0 deletions

View File

@ -217,6 +217,7 @@ def searchcomments(v):
tokens = map(lambda x: re.sub(r'[\0():|&*!<>]', '', x), criteria['q']) tokens = map(lambda x: re.sub(r'[\0():|&*!<>]', '', x), criteria['q'])
tokens = filter(lambda x: len(x) > 0, tokens) tokens = filter(lambda x: len(x) > 0, tokens)
tokens = map(lambda x: re.sub(r"'", "\\'", x), tokens) tokens = map(lambda x: re.sub(r"'", "\\'", x), tokens)
tokens = map(lambda x: x.strip(), tokens)
tokens = map(lambda x: re.sub(r'\s+', ' <-> ', x), tokens) tokens = map(lambda x: re.sub(r'\s+', ' <-> ', x), tokens)
comments = comments.filter(Comment.body_ts.match( comments = comments.filter(Comment.body_ts.match(
' & '.join(tokens), ' & '.join(tokens),