From 1021b9a1a6a52e44481e4bd6127629e47d5f36b4 Mon Sep 17 00:00:00 2001 From: Gabriel Mechali Date: Mon, 9 Dec 2024 11:35:28 -0500 Subject: [PATCH] Tiny little fix to stop triggering on 'the '. --- server/routes/shared_api/autocomplete/helpers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/routes/shared_api/autocomplete/helpers.py b/server/routes/shared_api/autocomplete/helpers.py index 668da7f2b6..1b05e1c851 100644 --- a/server/routes/shared_api/autocomplete/helpers.py +++ b/server/routes/shared_api/autocomplete/helpers.py @@ -75,7 +75,9 @@ def find_queries(user_query: str) -> List[str]: cumulative = "" last_word = words_in_query[-1].lower().strip() - if last_word in SKIP_AUTOCOMPLETE_TRIGGER: + if last_word in SKIP_AUTOCOMPLETE_TRIGGER or ( + last_word == "" and len(words_in_query) > 1 and + words_in_query[-2].lower().strip() in SKIP_AUTOCOMPLETE_TRIGGER): # don't return any queries. return []