Skip to content

Conversation

@ajcvickers
Copy link
Contributor

Replaces #1769

@ajcvickers ajcvickers requested a review from rstam October 17, 2025 11:30
@ajcvickers ajcvickers requested a review from a team as a code owner October 17, 2025 11:30
Copilot AI review requested due to automatic review settings October 17, 2025 11:30
Copy link

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

This PR implements typed builders for creating vector indexes in MongoDB Atlas, providing a strongly-typed C# API as an alternative to manually constructing BsonDocument definitions. The changes introduce new enums for vector similarity and quantization, a base class for index models, and a generic CreateVectorIndexModel<TDocument> class that leverages C# expressions for field selection.

Key changes:

  • Adds VectorSimilarity and VectorQuantization enums to represent vector search configuration options
  • Introduces CreateSearchIndexModelBase abstract class and refactors CreateSearchIndexModel to inherit from it
  • Implements CreateVectorIndexModel<TDocument> for type-safe vector index creation with support for filter fields and HNSW options

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/MongoDB.Driver/VectorSimilarity.cs Defines enum for vector similarity functions (Euclidean, Cosine, DotProduct)
src/MongoDB.Driver/VectorQuantization.cs Defines enum for vector quantization types (None, Scalar, Binary)
src/MongoDB.Driver/CreateSearchIndexModelBase.cs Introduces abstract base class for search index models
src/MongoDB.Driver/CreateSearchIndexModel.cs Refactors to inherit from base class and updates documentation
src/MongoDB.Driver/CreateVectorIndexModel.cs Implements typed vector index model with field expressions and rendering logic
src/MongoDB.Driver/Search/IMongoSearchIndexManager.cs Updates interface to accept base class type
src/MongoDB.Driver/MongoCollectionImpl.cs Updates implementation to handle both search and vector index models
tests/MongoDB.Driver.Tests/Search/AtlasSearchIndexManagmentTests.cs Adds comprehensive tests for typed vector index API and updates existing tests
evergreen/evergreen.yml Updates MongoDB version from 7.0 to 8.0 for search index tests

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

@ajcvickers
Copy link
Contributor Author

@rstam This is a new implementation which, I think, does the rendering properly.

@ajcvickers ajcvickers requested a review from rstam October 20, 2025 12:12
Copy link
Contributor

@rstam rstam left a comment

Choose a reason for hiding this comment

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

Two minor questions/suggestions.

@ajcvickers ajcvickers requested a review from rstam October 27, 2025 13:16
Copy link
Contributor

@rstam rstam left a comment

Choose a reason for hiding this comment

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

LGTM

@ajcvickers ajcvickers added the improvement Optimizations or refactoring (no new features or fixes). label Oct 28, 2025
@ajcvickers ajcvickers merged commit 17c8263 into mongodb:main Oct 28, 2025
34 of 37 checks passed
@ajcvickers ajcvickers added feature Adds new user-facing functionality. and removed improvement Optimizations or refactoring (no new features or fixes). labels Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adds new user-facing functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants