From 204b7fab81b124358ccae97fac8cbb8d4c6d79fd Mon Sep 17 00:00:00 2001 From: Jarian Cottingham Date: Thu, 2 Jul 2026 18:39:29 +0000 Subject: [PATCH] fix: skip fuzzy matching for short banned terms (<=3 chars) to prevent false positives --- web/server/routes/search.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/server/routes/search.py b/web/server/routes/search.py index e5c8e2a..9f2daca 100644 --- a/web/server/routes/search.py +++ b/web/server/routes/search.py @@ -71,6 +71,9 @@ def _is_banned(query: str) -> bool: if len(word) <= 3: continue for term in _banned_terms: + # Skip fuzzy matching for very short banned terms (too many false positives) + if len(term) <= 3: + continue # Only fuzzy match for terms with similar length if abs(len(word) - len(term)) > 2: continue