diff --git a/web/server/routes/search.py b/web/server/routes/search.py index 9f2daca..8c32aac 100644 --- a/web/server/routes/search.py +++ b/web/server/routes/search.py @@ -67,12 +67,12 @@ def _is_banned(query: str) -> bool: # Fuzzy match check for words in the query query_words = query_lower.split() for word in query_words: - # Skip very short words (3 chars or less) - if len(word) <= 3: + # Skip short words (4 chars or less) to avoid false positives (e.g. "lofi" matching "loli") + if len(word) <= 4: continue for term in _banned_terms: - # Skip fuzzy matching for very short banned terms (too many false positives) - if len(term) <= 3: + # Skip fuzzy matching for short banned terms (too many false positives) + if len(term) <= 4: continue # Only fuzzy match for terms with similar length if abs(len(word) - len(term)) > 2: