PHPLIB-1733: Support nested fields in vectorSearch#1912
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the aggregation builder’s $vectorSearch stage support to cover Atlas Vector Search nested-field use cases by adding support for parentFilter and nestedOptions, along with a new pipeline fixture and test to validate canonical Extended JSON output.
Changes:
- Added
parentFilterandnestedOptionssupport to thevectorSearchstage builder and fluent pipeline API. - Added a new test case and corresponding canonical JSON fixture for a nested-field
$vectorSearchexample. - Minor test refactor to use named-argument ordering consistently (e.g.,
limitmoved earlier in one call).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Builder/Stage/VectorSearchStageTest.php | Adds a nested-field $vectorSearch test using parentFilter and nestedOptions. |
| tests/Builder/Stage/Pipelines.php | Adds canonical Extended JSON fixture for the nested-field $vectorSearch pipeline. |
| src/Builder/Stage/VectorSearchStage.php | Adds new properties/constructor args and array-to-QueryObject conversion for parentFilter. |
| src/Builder/Stage/FluentFactoryTrait.php | Extends fluent vectorSearch() wrapper to accept the new options. |
| src/Builder/Stage/FactoryTrait.php | Extends static vectorSearch() factory to accept the new options. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
kevinAlbs
approved these changes
Jun 5, 2026
GromNaN
reviewed
Jun 8, 2026
GromNaN
approved these changes
Jun 8, 2026
GromNaN
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of DRIVERS-3308