Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

Autocomplete: don't suggest the current query.

Alexandre Flamentee3f230d9365
diff --git a/searx/webapp.py b/searx/webapp.py
index 425233a3b..2ec2f7edd 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: