1
0
mirror of https://github.com/searx/searx synced 2024-11-22 09:57:08 +01:00

[fix] Prevent missing setting error in ranking

Prevent error when the prefer_configured_language setting is missing.

Fixes #3063
This commit is contained in:
0xhtml 2021-11-16 16:12:36 +01:00
parent db2e8fd8b2
commit ebbb9f60af

View File

@ -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