Skip to content

Add typed builder API for vector search index definitions#1960

Open
rozza wants to merge 2 commits intomongodb:mainfrom
rozza:JAVA-6112
Open

Add typed builder API for vector search index definitions#1960
rozza wants to merge 2 commits intomongodb:mainfrom
rozza:JAVA-6112

Conversation

@rozza
Copy link
Copy Markdown
Member

@rozza rozza commented May 5, 2026

Add typed builder API for vector search index definitions

Introduced SearchIndexDefinition sealed interface with factory methods,
VectorSearchIndexFields (vectorField, filterField, autoEmbedField builders),
HnswSearchIndexOptions for HNSW-specific parameters, and
VectorSearchIndexDefinition as the concrete implementation.

Added Scala companion objects for SearchIndexDefinition and
VectorSearchIndexFields with delegating factory methods, and a
SearchIndexModel.apply overload for VectorSearchIndexDefinition.

Annotated mutable builders with @NotThreadSafe. Added fail-fast
null-element validation using notNullElements in factory methods.

Includes unit tests (Java) and spec tests (Scala).

JAVA-6112
JAVA-6099

This comment was marked as outdated.

This comment was marked as outdated.

@rozza rozza force-pushed the JAVA-6112 branch 3 times, most recently from e088d3c to 77460ff Compare May 6, 2026 10:07
@rozza rozza requested a review from Copilot May 6, 2026 10:08

This comment was marked as outdated.

@rozza rozza force-pushed the JAVA-6112 branch 2 times, most recently from 5f0919d to 2c77a75 Compare May 6, 2026 10:46
@rozza rozza marked this pull request as ready for review May 6, 2026 11:32
@rozza rozza requested a review from a team as a code owner May 6, 2026 11:32
@rozza rozza requested a review from vbabanin May 6, 2026 11:32
@nhachicha nhachicha requested a review from Copilot May 6, 2026 12:23

This comment was marked as outdated.

This comment was marked as outdated.

Introduced SearchIndexDefinition sealed interface with factory methods,
VectorSearchIndexFields (vectorField, filterField, autoEmbedField builders),
HnswSearchIndexOptions for HNSW-specific parameters, and
VectorSearchIndexDefinition as the concrete implementation.

Added Scala companion objects for SearchIndexDefinition and
VectorSearchIndexFields with delegating factory methods, and a
SearchIndexModel.apply overload for VectorSearchIndexDefinition.

Annotated mutable builders with @NotThreadSafe. Added fail-fast
null-element validation using notNullElements in factory methods.

Includes unit tests (Java) and spec tests (Scala).

JAVA-6112
JAVA-6099
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

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

Comment thread driver-core/src/main/com/mongodb/client/model/VectorSearchIndexFields.java Outdated
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

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

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.

2 participants