diff options
author | asciimoo <asciimoo@gmail.com> | 2013-11-02 18:07:48 +0100 |
---|---|---|
committer | asciimoo <asciimoo@gmail.com> | 2013-11-02 18:07:48 +0100 |
commit | 326a33fafeaade21cc97cea1fe5e50c0dbea40d5 (patch) | |
tree | f630e26f15512f50fe1a3fde50e7cc480b273afd /searx/engines/__init__.py | |
parent | cd268f90e29bb7804215a920d7de039e3f5d56b2 (diff) | |
download | searxng-326a33fafeaade21cc97cea1fe5e50c0dbea40d5.tar.gz searxng-326a33fafeaade21cc97cea1fe5e50c0dbea40d5.zip |
[enh] better url comparison
Diffstat (limited to 'searx/engines/__init__.py')
-rw-r--r-- | searx/engines/__init__.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index a1205f6c3..29ec5af16 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -147,8 +147,10 @@ def search(query, request, selected_categories): score = int((flat_len - i)/engines_len)*settings.weights.get(res['engine'], 1)+1 duplicated = False for new_res in results: + p1 = res['parsed_url'].path[:-1] if res['parsed_url'].path.endswith('/') else res['parsed_url'].path + p2 = new_res['parsed_url'].path[:-1] if new_res['parsed_url'].path.endswith('/') else new_res['parsed_url'].path if res['parsed_url'].netloc == new_res['parsed_url'].netloc and\ - res['parsed_url'].path == new_res['parsed_url'].path and\ + p1 == p2 and\ res['parsed_url'].query == new_res['parsed_url'].query and\ res.get('template') == new_res.get('template'): duplicated = new_res |