From ccc201b3a144c43ba423fe6d0c591c8956b5b535 Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 28 Feb 2024 22:00:38 +0200 Subject: [PATCH] remove now-unused code --- files/routes/search.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/files/routes/search.py b/files/routes/search.py index fdc8f7f42..fd157ae2c 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -90,14 +90,7 @@ def searchposts(v): ), 403 posts = posts.filter(Post.author_id == author.id) - if 'exact' in criteria and 'full_text' in criteria: - regex_str = '[[:<:]]'+criteria['full_text']+'[[:>:]]' # https://docs.oracle.com/cd/E17952_01/mysql-5.5-en/regexp.html "word boundaries" - if 'title' in criteria: - words = [Post.title.regexp_match(regex_str)] - else: - words = [or_(Post.title.regexp_match(regex_str), Post.body.regexp_match(regex_str))] - posts = posts.filter(*words) - elif 'q' in criteria: + if 'q' in criteria: if 'title' in criteria: words = [or_(Post.title.ilike('%'+x+'%')) \ for x in criteria['q']]