From ebbb9f60afb40ace1880f36df3ae18a83fb33410 Mon Sep 17 00:00:00 2001 From: 0xhtml <34682885+0xhtml@users.noreply.github.com> Date: Tue, 16 Nov 2021 16:12:36 +0100 Subject: [PATCH] [fix] Prevent missing setting error in ranking Prevent error when the prefer_configured_language setting is missing. Fixes #3063 --- searx/results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/results.py b/searx/results.py index 3acf1045..6502ddcd 100644 --- a/searx/results.py +++ b/searx/results.py @@ -137,7 +137,7 @@ def result_score(result, language): if hasattr(engines[result_engine], 'weight'): weight *= float(engines[result_engine].weight) - if settings['search']['prefer_configured_language']: + if settings['search'].get('prefer_configured_language', False): domain_parts = result['parsed_url'].netloc.split('.') if language in domain_parts: weight *= 1.1