mirror of https://github.com/searxng/searxng.git
[enh] better url comparison
This commit is contained in:
parent
cd268f90e2
commit
326a33fafe
|
@ -147,8 +147,10 @@ def search(query, request, selected_categories):
|
||||||
score = int((flat_len - i)/engines_len)*settings.weights.get(res['engine'], 1)+1
|
score = int((flat_len - i)/engines_len)*settings.weights.get(res['engine'], 1)+1
|
||||||
duplicated = False
|
duplicated = False
|
||||||
for new_res in results:
|
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\
|
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['parsed_url'].query == new_res['parsed_url'].query and\
|
||||||
res.get('template') == new_res.get('template'):
|
res.get('template') == new_res.get('template'):
|
||||||
duplicated = new_res
|
duplicated = new_res
|
||||||
|
|
Loading…
Reference in New Issue