diff options
author | Alexandre Flament <alex@al-f.net> | 2022-06-12 11:21:24 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2022-06-12 11:21:24 +0200 |
commit | ee3f230d9365556224e73e762063fcf6b079daaa (patch) | |
tree | 3fb00d8d47642f198cba1b51431f7ec553f07843 /searx/webapp.py | |
parent | 2455f1d06a3b05e4eb86be274c308160262e4a87 (diff) |
Autocomplete: don't suggest the current query.
Example of minor issue before this commit:
the autocompletion can suggest "Test" if the query is "Test".
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-x | searx/webapp.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 425233a3..2ec2f7ed 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -909,7 +909,8 @@ def autocompleter(): for result in raw_results: # attention: this loop will change raw_text_query object and this is # the reason why the sug_prefix was stored before (see above) - results.append(raw_text_query.changeQuery(result).getFullQuery()) + if result != sug_prefix: + results.append(raw_text_query.changeQuery(result).getFullQuery()) if len(raw_text_query.autocomplete_list) > 0: for autocomplete_text in raw_text_query.autocomplete_list: |