summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2023-09-10 18:44:16 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2023-09-19 09:40:57 +0200
commitdcee82334548ad8849391b5c29cdcd868b65daad (patch)
tree5313b41db400f0215c4b46a9af8bb51f1c11a8b2 /searx/webapp.py
parent71508abcbf77df7e996114e4f142a5f15eced6e4 (diff)
[feat] implement feeling lucky feature
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index fe6dd6b7..b2a76ff9 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -697,6 +697,10 @@ def search():
previous_result = None
results = result_container.get_ordered_results()
+
+ if search_query.redirect_to_first_result and results:
+ return redirect(results[0]['url'], 302)
+
for result in results:
if output_format == 'html':
if 'content' in result and result['content']: