Add typed builder API for vector search index definitions#1960
Open
rozza wants to merge 2 commits intomongodb:mainfrom
Open
Add typed builder API for vector search index definitions#1960rozza wants to merge 2 commits intomongodb:mainfrom
rozza wants to merge 2 commits intomongodb:mainfrom
Conversation
e088d3c to
77460ff
Compare
5f0919d to
2c77a75
Compare
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 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.
Add typed builder API for vector search index definitions
Introduced
SearchIndexDefinitionsealed interface with factory methods,VectorSearchIndexFields(vectorField,filterField,autoEmbedFieldbuilders),HnswSearchIndexOptionsfor HNSW-specific parameters, andVectorSearchIndexDefinitionas the concrete implementation.Added Scala companion objects for
SearchIndexDefinitionandVectorSearchIndexFieldswith delegating factory methods, and aSearchIndexModel.applyoverload forVectorSearchIndexDefinition.Annotated mutable builders with
@NotThreadSafe. Added fail-fastnull-element validation using notNullElements in factory methods.
Includes unit tests (Java) and spec tests (Scala).
JAVA-6112
JAVA-6099