From dcee82334548ad8849391b5c29cdcd868b65daad Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 10 Sep 2023 18:44:16 +0200 Subject: [feat] implement feeling lucky feature --- searx/webapp.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'searx/webapp.py') diff --git a/searx/webapp.py b/searx/webapp.py index fe6dd6b74..b2a76ff92 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']: -- cgit v1.2.3-54-g00ecf