Browse Source

Merge pull request #1315 from dalf/autocomplete-no-duplicate

Autocomplete: don't suggest the current query.
Markus Heiser 2 years ago
parent
commit
1bc5455db1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      searx/webapp.py

+ 2 - 1
searx/webapp.py

@@ -909,7 +909,8 @@ 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)
-            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:
     if len(raw_text_query.autocomplete_list) > 0:
         for autocomplete_text in raw_text_query.autocomplete_list:
         for autocomplete_text in raw_text_query.autocomplete_list: