Skip to content

Documentation for Vector Search#2846

Merged
GromNaN merged 2 commits intodoctrine:2.13.xfrom
GromNaN:PHPORM-346
Oct 15, 2025
Merged

Documentation for Vector Search#2846
GromNaN merged 2 commits intodoctrine:2.13.xfrom
GromNaN:PHPORM-346

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented Oct 3, 2025

Q A
Type documentation
BC Break no
Fixed issues PHPORM-346

Summary

Add a tutorial to use Vector Search with an embedding model.

@GromNaN GromNaN added this to the 2.13.0 milestone Oct 3, 2025
@GromNaN GromNaN requested a review from Copilot October 3, 2025 13:26
Copy link
Copy Markdown

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 documentation for using Vector Search with Doctrine MongoDB ODM, including a new cookbook tutorial and clarifies index requirements in stage reference docs.

  • Adds a comprehensive vector search cookbook with end-to-end example.
  • Inserts notes in aggregation stage reference about required search/vector search indexes.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
docs/en/reference/aggregation-stage-reference.rst Adds notes about required indexes for $search and $vectorSearch stages.
docs/en/cookbook/vector-search.rst New tutorial covering embedding generation, model definition, indexing, and querying.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +163 to +164
->queryVector(self::getVector())
->filter($qb->expr()->field('published')->equals(true))
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

The example references self::getVector() (undefined in the tutorial) and $qb (never defined). Use a concrete vector variable (e.g., $doc1->voyage3Vector) and replace the filter with a direct expression array, e.g. ->filter(['published' => true]).

Suggested change
->queryVector(self::getVector())
->filter($qb->expr()->field('published')->equals(true))
->queryVector($vectors)
->filter(['published' => true])

Copilot uses AI. Check for mistakes.
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.

The suggestion is incorrect, even if I find it interesting.

@GromNaN GromNaN force-pushed the PHPORM-346 branch 2 times, most recently from 3affecb to 4eb76e3 Compare October 3, 2025 15:56
field or fields which must be covered by an Atlas Vector Search index.
This stage is only available when using MongoDB Atlas. ``$vectorSearch`` must be
the first stage in the aggregation pipeline.
``$vectorSearch`` must be the first stage in the aggregation pipeline.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't want to keep the bit about it only being available in Atlas? I guess it's kind of implied by the prior sentence

Copy link
Copy Markdown
Member Author

@GromNaN GromNaN Oct 15, 2025

Choose a reason for hiding this comment

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

The requirements are detailed in the linked MongoDB documentation. The statement that Atlas is required is no longer entirely true with support of search features in the Enterprise version: https://www.mongodb.com/docs/kubernetes/current/tutorial/install-fts-vs-with-enterprise/

Copy link
Copy Markdown
Contributor

@paulinevos paulinevos left a comment

Choose a reason for hiding this comment

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

This is great. Very clear.

@GromNaN GromNaN merged commit acd69a8 into doctrine:2.13.x Oct 15, 2025
24 checks passed
@GromNaN GromNaN deleted the PHPORM-346 branch October 15, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants