Skip to content

PHPLIB-1739 Add builder support for the vectorSearch search operator#1908

Merged
GromNaN merged 2 commits into
mongodb:v2.xfrom
GromNaN:PHPLIB-1739
May 27, 2026
Merged

PHPLIB-1739 Add builder support for the vectorSearch search operator#1908
GromNaN merged 2 commits into
mongodb:v2.xfrom
GromNaN:PHPLIB-1739

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented May 26, 2026

Copilot AI review requested due to automatic review settings May 26, 2026 21:08
@GromNaN GromNaN requested a review from a team as a code owner May 26, 2026 21:08
@GromNaN GromNaN requested a review from paulinevos May 26, 2026 21:08
@GromNaN GromNaN requested review from alcaeus and removed request for paulinevos May 26, 2026 21:10
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 Atlas Search builder support for the $search stage’s vectorSearch operator, including fixture pipelines and tests to assert correct serialization.

Changes:

  • Introduces a new VectorSearchOperator builder 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.

Comment thread src/Builder/Search/VectorSearchOperator.php
Comment thread src/Builder/Search/FactoryTrait.php
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 26, 2026

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.69%. Comparing base (8da0d3d) to head (16d9465).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Builder/Search/VectorSearchOperator.php 90.00% 1 Missing ⚠️
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     
Flag Coverage Δ
6.0-replica_set 86.55% <91.66%> (+<0.01%) ⬆️
6.0-server 82.63% <91.66%> (+0.01%) ⬆️
6.0-sharded_cluster 86.34% <91.66%> (+<0.01%) ⬆️
8.0-replica_set 87.56% <91.66%> (+<0.01%) ⬆️
8.0-server 83.36% <91.66%> (+0.01%) ⬆️

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.

Copy link
Copy Markdown
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

LGTM pending merge of the upstream pull request

@GromNaN GromNaN requested a review from alcaeus May 27, 2026 09:40
@GromNaN GromNaN enabled auto-merge (squash) May 27, 2026 09:47
@GromNaN GromNaN merged commit 7582dc2 into mongodb:v2.x May 27, 2026
35 of 36 checks passed
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.

4 participants