mirror of
https://github.com/searx/searx
synced 2025-08-30 14:08:47 +00: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:
@@ -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
|
||||
|
Reference in New Issue
Block a user