summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorMarc Abonce Seguin <marc-abonce@mailbox.org>2018-01-18 20:51:27 -0600
committerMarc Abonce Seguin <marc-abonce@mailbox.org>2019-07-01 17:16:02 -0500
commit40272b0044a2ef520ff9c3fb3513c5a340663f22 (patch)
tree1c5c2fbc4537b7dfdaf50ab98605ba4371eeda76 /searx/webapp.py
parent69c8ad86f3505051c029146382cbaf9531a35a8a (diff)
[fix] never pass bangs to autocomplete suggestions
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 8290b6822..dd4c84098 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -636,8 +636,11 @@ def autocompleter():
# parse searx specific autocompleter results like !bang
raw_results = searx_bang(raw_text_query)
- # normal autocompletion results only appear if max 3 inner results returned
- if len(raw_results) <= 3 and completer:
+ # normal autocompletion results only appear if no inner results returned
+ # and there is a query part besides the engine and language bangs
+ if len(raw_results) == 0 and completer and (len(raw_text_query.query_parts) > 1 or
+ (len(raw_text_query.languages) == 0 and
+ not raw_text_query.specific)):
# get language from cookie
language = request.preferences.get_value('language')
if not language or language == 'all':