Skip to content

Commit

Permalink
VectorIndexDefinition: Refactors Code to Remove Support for `VectorIn…
Browse files Browse the repository at this point in the history
…dexShardKey` 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
  • Loading branch information
kundadebdatta authored Nov 1, 2024
1 parent eb0160e commit f8032b4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,7 @@ VectorIndexDefinition<T> WithIndexingSearchListSize(
/// applies to index types DiskANN and quantizedFlat.
/// </param>
/// <returns>An instance of the current <see cref="VectorIndexDefinition{T}"/>.</returns>
#if PREVIEW
public
#else
internal
#endif
VectorIndexDefinition<T> WithVectorIndexShardKey(
internal VectorIndexDefinition<T> WithVectorIndexShardKey(
string[] vectorIndexShardKey)
{
this.vectorIndexPath.VectorIndexShardKey = vectorIndexShardKey ?? throw new ArgumentNullException(nameof(vectorIndexShardKey));
Expand Down
10 changes: 3 additions & 7 deletions Microsoft.Azure.Cosmos/src/Resource/Settings/VectorIndexPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public sealed class VectorIndexPath

/// <summary>
/// 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.
/// </summary>
[JsonIgnore]
#if PREVIEW
Expand Down Expand Up @@ -102,14 +102,10 @@ int IndexingSearchListSize

/// <summary>
/// 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.
/// </summary>
[JsonProperty(PropertyName = "vectorIndexShardKey", NullValueHandling = NullValueHandling.Ignore)]
#if PREVIEW
public
#else
internal
#endif
string[] VectorIndexShardKey { get; set; }
internal string[] VectorIndexShardKey { get; set; }

/// <summary>
/// This contains additional values for scenarios where the SDK is not aware of new fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
Expand Down Expand Up @@ -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": [],
Expand All @@ -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": {}
Expand Down

0 comments on commit f8032b4

Please sign in to comment.