Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
70a01e5f
Commit
70a01e5f
authored
Jul 27, 2019
by
Dalf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] don't merge image results if the img_src is different
parent
23611897
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
results.py
searx/results.py
+12
-3
No files found.
searx/results.py
View file @
70a01e5f
...
...
@@ -212,11 +212,20 @@ class ResultContainer(object):
# check for duplicates
duplicated
=
False
result_template
=
result
.
get
(
'template'
)
for
merged_result
in
self
.
_merged_results
:
if
compare_urls
(
result
[
'parsed_url'
],
merged_result
[
'parsed_url'
])
\
and
result
.
get
(
'template'
)
==
merged_result
.
get
(
'template'
):
duplicated
=
merged_result
break
and
result_template
==
merged_result
.
get
(
'template'
):
if
result_template
!=
'images.html'
:
# not an image, same template, same url : it's a duplicate
duplicated
=
merged_result
break
else
:
# it's an image
# it's a duplicate if the parsed_url, template and img_src are differents
if
result
.
get
(
'img_src'
,
''
)
==
merged_result
.
get
(
'img_src'
,
''
):
duplicated
=
merged_result
break
# merge duplicates together
if
duplicated
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment