From 09154c1f0112f9e726bc6f28982db168334ae34b Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sun, 27 Oct 2013 14:34:35 +0100 Subject: [PATCH] [mod] results engines mods --- searx/engines/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 3c8186a31..0a2d504d5 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -135,6 +135,7 @@ def search(query, request, selected_categories): # deduplication + scoring 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) engines[res['engine']].stats['score_count'] += score duplicated = False @@ -149,7 +150,7 @@ def search(query, request, selected_categories): if len(res.get('content', '')) > len(duplicated.get('content', '')): duplicated['content'] = res['content'] duplicated['score'] += score - duplicated['engine'] += ', '+res['engine'] + duplicated['engines'].append(res['engine']) if duplicated['parsed_url'].scheme == 'https': continue elif res['parsed_url'].scheme == 'https':