From 40272b0044a2ef520ff9c3fb3513c5a340663f22 Mon Sep 17 00:00:00 2001 From: Marc Abonce Seguin Date: Thu, 18 Jan 2018 20:51:27 -0600 Subject: [fix] never pass bangs to autocomplete suggestions --- searx/webapp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'searx/webapp.py') 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': -- cgit v1.2.3 From 6626f013656d39bc90d179e6706825552a8e588d Mon Sep 17 00:00:00 2001 From: Marc Abonce Seguin Date: Mon, 1 Jul 2019 19:52:34 -0500 Subject: [fix] preserve bangs in suggestions and corrections --- searx/webapp.py | 1 + 1 file changed, 1 insertion(+) (limited to 'searx/webapp.py') diff --git a/searx/webapp.py b/searx/webapp.py index dd4c84098..4c983509d 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -584,6 +584,7 @@ def index(): 'results.html', results=results, q=request.form['q'], + query_prefix=u''.join((request.form['q']).rsplit(search_query.query.decode('utf-8'), 1)), selected_categories=search_query.categories, pageno=search_query.pageno, time_range=search_query.time_range, -- cgit v1.2.3