Skip to content

Duplicate from different engines - #481

Merged
castelao merged 3 commits into
mainfrom
fix/duplicate_multiple_engines
Jun 29, 2026
Merged

Duplicate from different engines#481
castelao merged 3 commits into
mainfrom
fix/duplicate_multiple_engines

Conversation

@castelao

@castelao castelao commented Jun 27, 2026

Copy link
Copy Markdown
Member

The criteria used to be (engine, url), but we actually want the same URL only once, and we should take advantage on the agreement between multiple engines.

In one extreme, if both engines give exact the same result, it won't affect the order, otherwise, it prioritize what distinct engines agree on.

This PR also fix a mistake in the search engine criteria. Originally it was ordering by the name of the engine, while now it is by the order it was defined in the config, i.e. first listed engine has priority.

@castelao
castelao requested a review from Copilot June 27, 2026 00:06
@castelao castelao self-assigned this Jun 27, 2026
@castelao castelao added the bugfix Fixed a known bug label Jun 27, 2026
@castelao castelao changed the title fix: Duplicate between different engines Duplicate from different engines Jun 27, 2026
@codecov-commenter

codecov-commenter commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.72%. Comparing base (8290f5e) to head (a70eafa).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #481   +/-   ##
=======================================
  Coverage   61.72%   61.72%           
=======================================
  Files          77       77           
  Lines        6937     6937           
  Branches      690      690           
=======================================
  Hits         4282     4282           
  Misses       2535     2535           
  Partials      120      120           
Flag Coverage Δ
unittests 61.72% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates duplicate-handling for web search results so the same URL is treated as a duplicate even when returned by different search engines, enabling the ranking logic to leverage cross-engine agreement.

Changes:

  • Update _apply_duplicate_filters to deduplicate by URL across all search engines (instead of (engine, url)).
  • Add a unit test asserting that identical URLs from different engines are collapsed and tracked via the duplicates field.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
compass/web/search.py Changes duplicate keying to URL-only so duplicates collapse across engines and can influence ranking via duplicates count.
tests/python/unit/web/test_web_search.py Adds coverage ensuring same-URL results from different engines are marked as duplicates and recorded under the winner.

@castelao
castelao marked this pull request as ready for review June 27, 2026 00:35
@castelao
castelao requested a review from ppinchuk as a code owner June 27, 2026 00:35
ppinchuk
ppinchuk previously approved these changes Jun 27, 2026

@ppinchuk ppinchuk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is great!

castelao added 3 commits June 29, 2026 08:06
The criteria used to be (engine, url), but we actually one the same URL
only once, and we should take advantage on the agreement between
multiple engines.

In one extreme, if both engines give exact the same result, it won't
affect the order, otherwise, it prioritize what distinct engines agree on.
Before, it was order by the name of the engine (alphabetic).
@castelao
castelao force-pushed the fix/duplicate_multiple_engines branch from b2a6651 to a70eafa Compare June 29, 2026 14:06
@castelao
castelao merged commit 89c1b72 into main Jun 29, 2026
22 checks passed
@castelao
castelao deleted the fix/duplicate_multiple_engines branch June 29, 2026 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixed a known bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants