Browse Source

results: make engines of results set

Previously, if a same result was returned from the
same engine, the name of the engine would be added
more than once. To eliminate engine name duplication
engine list was changed to set.
Noémi Ványi 7 years ago
parent
commit
59c02e8e5f
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      searx/results.py

+ 2
- 2
searx/results.py View File

197
             result['parsed_url'] = result['parsed_url']._replace(scheme="http")
197
             result['parsed_url'] = result['parsed_url']._replace(scheme="http")
198
             result['url'] = result['parsed_url'].geturl()
198
             result['url'] = result['parsed_url'].geturl()
199
 
199
 
200
-        result['engines'] = [result['engine']]
200
+        result['engines'] = set([result['engine']])
201
 
201
 
202
         # strip multiple spaces and cariage returns from content
202
         # strip multiple spaces and cariage returns from content
203
         if result.get('content'):
203
         if result.get('content'):
227
             duplicated['positions'].append(position)
227
             duplicated['positions'].append(position)
228
 
228
 
229
             # add engine to list of result-engines
229
             # add engine to list of result-engines
230
-            duplicated['engines'].append(result['engine'])
230
+            duplicated['engines'].add(result['engine'])
231
 
231
 
232
             # using https if possible
232
             # using https if possible
233
             if duplicated['parsed_url'].scheme != 'https' and result['parsed_url'].scheme == 'https':
233
             if duplicated['parsed_url'].scheme != 'https' and result['parsed_url'].scheme == 'https':