-
Notifications
You must be signed in to change notification settings - Fork 2.1k
VectorIndex Policy: Adds Support for QuantizerType in IndexingPolicy #47566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
VectorIndex Policy: Adds Support for QuantizerType in IndexingPolicy #47566
Conversation
There was a problem hiding this 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 pull request adds support for quantizer types in vector index specifications for Azure Cosmos DB. The main purpose is to allow users to specify either "product" or "spherical" quantizer types when defining vector indexes in the indexing policy.
Key Changes:
- Introduced a new
QuantizerTypeenum with two values:productandspherical - Added
quantizerTypefield toCosmosVectorIndexSpecwith corresponding getter/setter methods - Updated
CosmosVectorEmbeddingPolicy.setCosmosVectorEmbeddings()to return the policy instance for fluent API consistency - Enhanced tests to validate serialization/deserialization of the new quantizer type field
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
QuantizerType.java |
New enum defining product and spherical quantizer types for vector indexes |
CosmosVectorIndexSpec.java |
Added quantizerType field with getter/setter methods to support the new property |
CosmosVectorEmbeddingPolicy.java |
Changed setCosmosVectorEmbeddings to return policy instance for fluent API pattern |
Constants.java |
Added QUANTIZER_TYPE constant for JSON property serialization |
CHANGELOG.md |
Documented the new QuantizerType feature |
VectorIndexTest.java |
Updated tests to validate quantizer type serialization/deserialization and refactored test code to use fluent builder pattern |
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/QuantizerType.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/QuantizerType.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/QuantizerType.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/QuantizerType.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Constants.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorIndexSpec.java
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/QuantizerType.java
Show resolved
Hide resolved
simorenoh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment, LGTM otherwise
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/models/CosmosVectorEmbeddingPolicy.java
Outdated
Show resolved
Hide resolved
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Description
Example:
Type of change
Testing against a live account that has Vector Search for NoSQL API feature enabled:
Check in portal and it has the

quantizerTyupevalue configured asproduct/sphericalAll SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines