Skip to content

PHPLIB-1624 Add $rankFusion stage and $sigmoid expression#1885

Merged
paulinevos merged 1 commit into
mongodb:v2.xfrom
GromNaN:PHPLIB-1624
May 1, 2026
Merged

PHPLIB-1624 Add $rankFusion stage and $sigmoid expression#1885
paulinevos merged 1 commit into
mongodb:v2.xfrom
GromNaN:PHPLIB-1624

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented Apr 29, 2026

Comment on lines +41 to +46
combination: object(
weights: object(
searchPlot: 0.6,
searchGenre: 0.4,
)
),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Usage of object is breaking the type system.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I presume this would be fixed by #1886?

@GromNaN GromNaN requested a review from alcaeus April 29, 2026 13:01
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.72%. Comparing base (12e5646) to head (d206247).
⚠️ Report is 1 commits behind head on v2.x.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Builder/Stage/FluentFactoryTrait.php 0.00% 3 Missing ⚠️
src/Builder/Expression/SigmoidOperator.php 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               v2.x    #1885      +/-   ##
============================================
- Coverage     87.75%   87.72%   -0.04%     
- Complexity     3308     3315       +7     
============================================
  Files           447      449       +2     
  Lines          6607     6622      +15     
============================================
+ Hits           5798     5809      +11     
- Misses          809      813       +4     
Flag Coverage Δ
6.0-replica_set 86.55% <73.33%> (-0.04%) ⬇️
6.0-server 82.58% <73.33%> (-0.03%) ⬇️
6.0-sharded_cluster 86.34% <73.33%> (-0.03%) ⬇️
8.0-replica_set 87.58% <73.33%> (-0.04%) ⬇️
8.0-server 83.32% <73.33%> (-0.03%) ⬇️
8.0-sharded_cluster 87.42% <73.33%> (?)

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

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

@GromNaN GromNaN force-pushed the PHPLIB-1624 branch 2 times, most recently from cec3562 to 5af1f5e Compare April 29, 2026 15:32
@GromNaN GromNaN marked this pull request as ready for review April 29, 2026 15:33
@GromNaN GromNaN requested a review from a team as a code owner April 29, 2026 15:33
Copilot AI review requested due to automatic review settings April 29, 2026 15:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds builder support for MongoDB 8.1’s new $rankFusion aggregation stage and $sigmoid aggregation expression, along with canonical JSON fixtures and tests to validate encoding through the BuilderEncoder.

Changes:

  • Introduces RankFusionStage and wires it into the Stage factory + fluent pipeline builder.
  • Introduces SigmoidOperator and wires it into the Expression factory.
  • Adds pipeline fixture entries and new PHPUnit tests covering both features.

Reviewed changes

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

Show a summary per file
File Description
tests/Builder/Stage/RankFusionStageTest.php New test asserting $rankFusion pipeline encoding matches canonical fixture.
tests/Builder/Stage/Pipelines.php Adds canonical extended JSON fixture for $rankFusion example pipeline.
tests/Builder/Expression/SigmoidOperatorTest.php New test asserting $sigmoid expression encoding matches canonical fixture.
tests/Builder/Expression/Pipelines.php Adds canonical extended JSON fixture for $sigmoid example pipeline.
src/Builder/Stage/RankFusionStage.php New auto-generated stage operator class for $rankFusion.
src/Builder/Stage/FluentFactoryTrait.php Adds fluent rankFusion() stage helper.
src/Builder/Stage/FactoryTrait.php Adds static rankFusion() stage factory method.
src/Builder/Expression/SigmoidOperator.php New auto-generated expression operator class for $sigmoid.
src/Builder/Expression/FactoryTrait.php Adds static sigmoid() expression factory method.

@GromNaN GromNaN requested a review from paulinevos April 30, 2026 14:10
@paulinevos paulinevos merged commit e551508 into mongodb:v2.x May 1, 2026
39 checks passed
@GromNaN GromNaN deleted the PHPLIB-1624 branch May 1, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants