1
0
mirror of https://github.com/searxng/searxng.git synced 2024-09-30 00:20:19 +02:00

Autocomplete: don't suggest the current query.

Example of minor issue before this commit:
the autocompletion can suggest "Test" if the query is "Test".
This commit is contained in:
Alexandre Flament 2022-06-12 11:21:24 +02:00
parent 2455f1d06a
commit ee3f230d93

View File

@ -909,6 +909,7 @@ def autocompleter():
for result in raw_results: for result in raw_results:
# attention: this loop will change raw_text_query object and this is # attention: this loop will change raw_text_query object and this is
# the reason why the sug_prefix was stored before (see above) # the reason why the sug_prefix was stored before (see above)
if result != sug_prefix:
results.append(raw_text_query.changeQuery(result).getFullQuery()) results.append(raw_text_query.changeQuery(result).getFullQuery())
if len(raw_text_query.autocomplete_list) > 0: if len(raw_text_query.autocomplete_list) > 0: