summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index e1b6bea1c..5d9614789 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -575,7 +575,9 @@ def index():
search_query, raw_text_query = get_search_query_from_webapp(request.preferences, request.form)
# search = Search(search_query) # without plugins
search = SearchWithPlugins(search_query, request.user_plugins, request)
+
result_container = search.search()
+
except Exception as e:
# log exception
logger.exception('search error')
@@ -592,6 +594,10 @@ def index():
if number_of_results < result_container.results_length():
number_of_results = 0
+ # checkin for a external bang
+ if result_container.redirect_url:
+ return redirect(result_container.redirect_url)
+
# UI
advanced_search = request.form.get('advanced_search', None)
@@ -665,6 +671,7 @@ def index():
cont_disp = 'attachment;Filename=searx_-_{0}.csv'.format(search_query.query.decode('utf-8'))
response.headers.add('Content-Disposition', cont_disp)
return response
+
elif output_format == 'rss':
response_rss = render(
'opensearch_response_rss.xml',