From f01e67dbd4a8205ac34996c658670d8e339c10b0 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sun, 27 Oct 2013 14:48:16 +0100 Subject: [PATCH] [mod] scoring mods --- searx/engines/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 3f97c59c6..371fa8fad 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -136,7 +136,7 @@ def search(query, request, selected_categories): for i,res in enumerate(flat_res): res['parsed_url'] = urlparse(res['url']) res['engines'] = [res['engine']] - score = (flat_len - i)*settings.weights.get(res['engine'], 1) + score = (flat_len - i - flat_len%len(engines))*settings.weights.get(res['engine'], 1) duplicated = False for new_res in results: if res['parsed_url'].netloc == new_res['parsed_url'].netloc and\ @@ -176,7 +176,7 @@ def get_engines_stats(): results_num = engine.stats['result_count']/float(engine.stats['search_count']) load_times = engine.stats['page_load_time']/float(engine.stats['search_count']) if results_num: - score = engine.stats['score_count'] / float(engine.stats['search_count']) / results_num + score = engine.stats['score_count'] / float(engine.stats['search_count']) else: score = 0 max_results = max(results_num, max_results)