Ver código fonte

[enh] merging only results with same rendering templates

asciimoo 11 anos atrás
pai
commit
5e358ea9a9
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2
    1
      searx/engines/__init__.py

+ 2
- 1
searx/engines/__init__.py Ver arquivo

106
         for new_res in results:
106
         for new_res in results:
107
             if res['parsed_url'].netloc == new_res['parsed_url'].netloc and\
107
             if res['parsed_url'].netloc == new_res['parsed_url'].netloc and\
108
                res['parsed_url'].path == new_res['parsed_url'].path and\
108
                res['parsed_url'].path == new_res['parsed_url'].path and\
109
-               res['parsed_url'].query == new_res['parsed_url'].query:
109
+               res['parsed_url'].query == new_res['parsed_url'].query and\
110
+               res.get('template') == new_res.get('template'):
110
                 duplicated = new_res
111
                 duplicated = new_res
111
                 break
112
                 break
112
         if duplicated:
113
         if duplicated: