diff --git a/handlers/search.py b/handlers/search.py index 00412db..2e79b66 100644 --- a/handlers/search.py +++ b/handlers/search.py @@ -37,6 +37,14 @@ def get(self, base36_id=None): current_user_obj = self.get_current_user_object() q = self.get_argument("q", "") + + # Take care of an mysql specific case where prepending an @ to a token + # causes a query syntax error. Wrap any token like that in double + # quotes first. + # More info: @distance fulltext search proximity operator + # https://dev.mysql.com/doc/refman/8.4/en/fulltext-boolean.html + q = re.sub(r'(?