From 08446c2245c0766e29c38ac912cbaa5a4626ebad Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Fri, 1 Nov 2024 07:58:10 -0700 Subject: [PATCH] VectorIndexDefinition: Refactors Code to Remove Support for `VectorIndexShardKey` from Preview Contract (#4863) # Pull Request Template ## Description This PR removes support for `VectorIndexShardKey` from Preview Contract. ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) - [x] This change requires a documentation update ## Closing issues To automatically close an issue: closes #IssueNumber --- .../Fluent/Settings/VectorIndexDefinition.cs | 7 +---- .../src/Resource/Settings/VectorIndexPath.cs | 10 +++---- .../Contracts/DotNetPreviewSDKAPI.json | 26 ------------------- 3 files changed, 4 insertions(+), 39 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Fluent/Settings/VectorIndexDefinition.cs b/Microsoft.Azure.Cosmos/src/Fluent/Settings/VectorIndexDefinition.cs index 8bf1310187..460fbbc116 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/Settings/VectorIndexDefinition.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/Settings/VectorIndexDefinition.cs @@ -98,12 +98,7 @@ VectorIndexDefinition WithIndexingSearchListSize( /// applies to index types DiskANN and quantizedFlat. /// /// An instance of the current . -#if PREVIEW - public -#else - internal -#endif - VectorIndexDefinition WithVectorIndexShardKey( + internal VectorIndexDefinition WithVectorIndexShardKey( string[] vectorIndexShardKey) { this.vectorIndexPath.VectorIndexShardKey = vectorIndexShardKey ?? throw new ArgumentNullException(nameof(vectorIndexShardKey)); diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/VectorIndexPath.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/VectorIndexPath.cs index 941432c682..d288b67ce8 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/VectorIndexPath.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/VectorIndexPath.cs @@ -70,7 +70,7 @@ public sealed class VectorIndexPath /// /// Gets or sets the quantization byte size for the vector index path. This is only applicable for the quantizedFlat and diskann vector index types. - /// The allowed range for this parameter is between 1 and 3. + /// The allowed range for this parameter is between 1 and the minimum of vector dimensions and 512. /// [JsonIgnore] #if PREVIEW @@ -102,14 +102,10 @@ int IndexingSearchListSize /// /// Gets or sets the vector index shard key for the vector index path. This is only applicable for the quantizedFlat and diskann vector index types. + /// The maximum length of the vector index shard key is 1. /// [JsonProperty(PropertyName = "vectorIndexShardKey", NullValueHandling = NullValueHandling.Ignore)] -#if PREVIEW - public -#else - internal -#endif - string[] VectorIndexShardKey { get; set; } + internal string[] VectorIndexShardKey { get; set; } /// /// This contains additional values for scenarios where the SDK is not aware of new fields. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 4f9687971f..f68d7b8ecd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -538,11 +538,6 @@ "Type": "Method", "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.VectorIndexDefinition`1[T] WithQuantizationByteSize(Int32);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.Fluent.VectorIndexDefinition`1[T] WithVectorIndexShardKey(System.String[])": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.VectorIndexDefinition`1[T] WithVectorIndexShardKey(System.String[]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} @@ -783,20 +778,6 @@ ], "MethodInfo": "Int32 QuantizationByteSize;CanRead:True;CanWrite:True;Int32 get_QuantizationByteSize();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_QuantizationByteSize(Int32);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "System.String[] get_VectorIndexShardKey()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "System.String[] get_VectorIndexShardKey();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "System.String[] VectorIndexShardKey[Newtonsoft.Json.JsonPropertyAttribute(NullValueHandling = 1, PropertyName = \"vectorIndexShardKey\")]": { - "Type": "Property", - "Attributes": [ - "JsonPropertyAttribute" - ], - "MethodInfo": "System.String[] VectorIndexShardKey;CanRead:True;CanWrite:True;System.String[] get_VectorIndexShardKey();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_VectorIndexShardKey(System.String[]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, "Void set_IndexingSearchListSize(Int32)": { "Type": "Method", "Attributes": [], @@ -806,13 +787,6 @@ "Type": "Method", "Attributes": [], "MethodInfo": "Void set_QuantizationByteSize(Int32);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void set_VectorIndexShardKey(System.String[])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_VectorIndexShardKey(System.String[]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {}