mirror of
https://github.com/searxng/searxng
synced 2024-01-01 18:24:07 +00:00
[enh] custom engine result weights
This commit is contained in:
parent
5ee0b7bb80
commit
38c003bf3d
@ -92,7 +92,7 @@ def search(query, request, selected_engines):
|
|||||||
# deduplication + scoring
|
# deduplication + scoring
|
||||||
for i,res in enumerate(flat_res):
|
for i,res in enumerate(flat_res):
|
||||||
res['parsed_url'] = urlparse(res['url'])
|
res['parsed_url'] = urlparse(res['url'])
|
||||||
score = flat_len - i
|
score = (flat_len - i)*settings.weights.get(res['engine'], 1)
|
||||||
duplicated = False
|
duplicated = False
|
||||||
for new_res in results:
|
for new_res in results:
|
||||||
if res['parsed_url'].netloc == new_res['parsed_url'].netloc and\
|
if res['parsed_url'].netloc == new_res['parsed_url'].netloc and\
|
||||||
|
Loading…
Reference in New Issue
Block a user