Skip to content

Commit

Permalink
Tiny little fix to stop triggering on 'the '. (datacommonsorg#4783)
Browse files Browse the repository at this point in the history
Skipping autocomplete on the key words essentially did not work if you
added the space after, it would trigger at that point. This resolves it.
  • Loading branch information
gmechali authored Dec 11, 2024
1 parent 666e4aa commit 465e0ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/routes/shared_api/autocomplete/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []

Expand Down

0 comments on commit 465e0ad

Please sign in to comment.