PHPLIB-1739 Add builder support for the vectorSearch search operator#1908
Conversation
There was a problem hiding this comment.
Pull request overview
Adds Atlas Search builder support for the $search stage’s vectorSearch operator, including fixture pipelines and tests to assert correct serialization.
Changes:
- Introduces a new
VectorSearchOperatorbuilder for$search: { vectorSearch: ... }. - Exposes the operator via
MongoDB\Builder\Search::vectorSearch()factory method. - Adds pipeline fixtures and PHPUnit coverage for ANN/ENN examples (including filter usage).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/Builder/Search/VectorSearchOperatorTest.php | Adds coverage for building $search.vectorSearch pipelines (ANN basic/filter + ENN). |
| tests/Builder/Search/Pipelines.php | Adds expected JSON fixtures for the new vector search operator pipelines. |
| src/Builder/Search/VectorSearchOperator.php | Implements the new search operator builder and argument validation for list vectors. |
| src/Builder/Search/FactoryTrait.php | Adds vectorSearch() factory method to construct the new operator. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2.x #1908 +/- ##
=========================================
Coverage 87.69% 87.69%
- Complexity 3356 3360 +4
=========================================
Files 457 458 +1
Lines 6702 6714 +12
=========================================
+ Hits 5877 5888 +11
- Misses 825 826 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
alcaeus
left a comment
There was a problem hiding this comment.
LGTM pending merge of the upstream pull request
Uh oh!
There was an error while loading. Please reload this page.