summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2016-12-30 17:16:53 +0100
committerAlexandre Flament <alex@al-f.net>2016-12-30 17:18:02 +0100
commit3a8ab5880a7e48470f56ddf18f80ff626c4f31c7 (patch)
treec4006a03aaa8b763153c4b87397b276a98e704ad /searx
parenteaa0fb8102825fa4ccdb348429fdbf39837921be (diff)
downloadsearxng-3a8ab5880a7e48470f56ddf18f80ff626c4f31c7.tar.gz
searxng-3a8ab5880a7e48470f56ddf18f80ff626c4f31c7.zip
[mod] result_container.extend sets result['engine'] = engine_name for each result
Diffstat (limited to 'searx')
-rw-r--r--searx/results.py1
-rw-r--r--searx/search.py2
2 files changed, 1 insertions, 2 deletions
diff --git a/searx/results.py b/searx/results.py
index 73a96c081..6062f8013 100644
--- a/searx/results.py
+++ b/searx/results.py
@@ -133,6 +133,7 @@ class ResultContainer(object):
def extend(self, engine_name, results):
for result in list(results):
+ result['engine'] = engine_name
if 'suggestion' in result:
self.suggestions.add(result['suggestion'])
results.remove(result)
diff --git a/searx/search.py b/searx/search.py
index c592c655a..18bda3349 100644
--- a/searx/search.py
+++ b/searx/search.py
@@ -108,8 +108,6 @@ def search_one_request_safe(engine_name, query, request_params, result_container
search_results = search_one_request(engine, query, request_params, timeout_limit)
# add results
- for result in search_results:
- result['engine'] = engine_name
result_container.extend(engine_name, search_results)
# update engine time when there is no exception