forked from Ponysearch/Ponysearch
[mod] result_container.extend sets result['engine'] = engine_name for each result
This commit is contained in:
parent
eaa0fb8102
commit
3a8ab5880a
2 changed files with 1 additions and 2 deletions
|
@ -133,6 +133,7 @@ class ResultContainer(object):
|
||||||
|
|
||||||
def extend(self, engine_name, results):
|
def extend(self, engine_name, results):
|
||||||
for result in list(results):
|
for result in list(results):
|
||||||
|
result['engine'] = engine_name
|
||||||
if 'suggestion' in result:
|
if 'suggestion' in result:
|
||||||
self.suggestions.add(result['suggestion'])
|
self.suggestions.add(result['suggestion'])
|
||||||
results.remove(result)
|
results.remove(result)
|
||||||
|
|
|
@ -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)
|
search_results = search_one_request(engine, query, request_params, timeout_limit)
|
||||||
|
|
||||||
# add results
|
# add results
|
||||||
for result in search_results:
|
|
||||||
result['engine'] = engine_name
|
|
||||||
result_container.extend(engine_name, search_results)
|
result_container.extend(engine_name, search_results)
|
||||||
|
|
||||||
# update engine time when there is no exception
|
# update engine time when there is no exception
|
||||||
|
|
Loading…
Reference in a new issue