logo

searx

Unnamed repository; edit this file 'description' to name the repository.
commit: 0f301adf60ace81dd1ceef16fe568d9a6d71c939
parent: 09154c1f0112f9e726bc6f28982db168334ae34b
Author: asciimoo <asciimoo@gmail.com>
Date:   Sun, 27 Oct 2013 14:39:23 +0100

[enh] score stat mods

Diffstat:

searx/engines/__init__.py | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py @@ -137,7 +137,6 @@ def search(query, request, selected_categories): res['parsed_url'] = urlparse(res['url']) res['engines'] = [res['engine']] score = (flat_len - i)*settings.weights.get(res['engine'], 1) - engines[res['engine']].stats['score_count'] += score duplicated = False for new_res in results: if res['parsed_url'].netloc == new_res['parsed_url'].netloc and\ @@ -159,6 +158,10 @@ def search(query, request, selected_categories): res['score'] = score results.append(res) + for result in results: + for res_engine in result['engines']: + engines[result['engine']].stats['score_count'] += result['score'] + return sorted(results, key=itemgetter('score'), reverse=True) def get_engines_stats():