mirror of https://github.com/searx/searx
Merge pull request #3064 from 0xhtml/fix-3063
[fix] Prevent missing setting error in ranking
This commit is contained in:
commit
f5b1c3fd28
|
@ -137,7 +137,7 @@ def result_score(result, language):
|
||||||
if hasattr(engines[result_engine], 'weight'):
|
if hasattr(engines[result_engine], 'weight'):
|
||||||
weight *= float(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('.')
|
domain_parts = result['parsed_url'].netloc.split('.')
|
||||||
if language in domain_parts:
|
if language in domain_parts:
|
||||||
weight *= 1.1
|
weight *= 1.1
|
||||||
|
|
Loading…
Reference in New Issue