mirror of https://github.com/searx/searx
[fix] Prevent missing setting error in ranking
Prevent error when the prefer_configured_language setting is missing. Fixes #3063
This commit is contained in:
parent
db2e8fd8b2
commit
ebbb9f60af
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue