PHPLIB-1624 Add $rankFusion stage and $sigmoid expression#1885
Conversation
| combination: object( | ||
| weights: object( | ||
| searchPlot: 0.6, | ||
| searchGenre: 0.4, | ||
| ) | ||
| ), |
There was a problem hiding this comment.
Usage of object is breaking the type system.
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
cec3562 to
5af1f5e
Compare
There was a problem hiding this comment.
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
RankFusionStageand wires it into the Stage factory + fluent pipeline builder. - Introduces
SigmoidOperatorand 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. |
Fix PHPLIB-1624