Browse Source

[mod] result_container.extend sets result['engine'] = engine_name for each result

Alexandre Flament 8 years ago
parent
commit
3a8ab5880a
2 changed files with 1 additions and 2 deletions
  1. 1
    0
      searx/results.py
  2. 0
    2
      searx/search.py

+ 1
- 0
searx/results.py View File

@@ -133,6 +133,7 @@ class ResultContainer(object):
133 133
 
134 134
     def extend(self, engine_name, results):
135 135
         for result in list(results):
136
+            result['engine'] = engine_name
136 137
             if 'suggestion' in result:
137 138
                 self.suggestions.add(result['suggestion'])
138 139
                 results.remove(result)

+ 0
- 2
searx/search.py View File

@@ -108,8 +108,6 @@ def search_one_request_safe(engine_name, query, request_params, result_container
108 108
         search_results = search_one_request(engine, query, request_params, timeout_limit)
109 109
 
110 110
         # add results
111
-        for result in search_results:
112
-            result['engine'] = engine_name
113 111
         result_container.extend(engine_name, search_results)
114 112
 
115 113
         # update engine time when there is no exception