Skip to content

Commit 38699c9

Browse files
committed
Revert "VectorIndexDefinition: Refactors Code to Remove Support for VectorIndexShardKey from Preview Contract (#4863)"
This reverts commit f8032b4.
1 parent 72f9deb commit 38699c9

File tree

3 files changed

+39
-4
lines changed

3 files changed

+39
-4
lines changed

Microsoft.Azure.Cosmos/src/Fluent/Settings/VectorIndexDefinition.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,12 @@ VectorIndexDefinition<T> WithIndexingSearchListSize(
9898
/// applies to index types DiskANN and quantizedFlat.
9999
/// </param>
100100
/// <returns>An instance of the current <see cref="VectorIndexDefinition{T}"/>.</returns>
101-
internal VectorIndexDefinition<T> WithVectorIndexShardKey(
101+
#if PREVIEW
102+
public
103+
#else
104+
internal
105+
#endif
106+
VectorIndexDefinition<T> WithVectorIndexShardKey(
102107
string[] vectorIndexShardKey)
103108
{
104109
this.vectorIndexPath.VectorIndexShardKey = vectorIndexShardKey ?? throw new ArgumentNullException(nameof(vectorIndexShardKey));

Microsoft.Azure.Cosmos/src/Resource/Settings/VectorIndexPath.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public sealed class VectorIndexPath
7070

7171
/// <summary>
7272
/// Gets or sets the quantization byte size for the vector index path. This is only applicable for the quantizedFlat and diskann vector index types.
73-
/// The allowed range for this parameter is between 1 and the minimum of vector dimensions and 512.
73+
/// The allowed range for this parameter is between 1 and 3.
7474
/// </summary>
7575
[JsonIgnore]
7676
#if PREVIEW
@@ -102,10 +102,14 @@ int IndexingSearchListSize
102102

103103
/// <summary>
104104
/// 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.
105-
/// The maximum length of the vector index shard key is 1.
106105
/// </summary>
107106
[JsonProperty(PropertyName = "vectorIndexShardKey", NullValueHandling = NullValueHandling.Ignore)]
108-
internal string[] VectorIndexShardKey { get; set; }
107+
#if PREVIEW
108+
public
109+
#else
110+
internal
111+
#endif
112+
string[] VectorIndexShardKey { get; set; }
109113

110114
/// <summary>
111115
/// This contains additional values for scenarios where the SDK is not aware of new fields.

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,11 @@
12491249
"Type": "Method",
12501250
"Attributes": [],
12511251
"MethodInfo": "Microsoft.Azure.Cosmos.Fluent.VectorIndexDefinition`1[T] WithQuantizationByteSize(Int32);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
1252+
},
1253+
"Microsoft.Azure.Cosmos.Fluent.VectorIndexDefinition`1[T] WithVectorIndexShardKey(System.String[])": {
1254+
"Type": "Method",
1255+
"Attributes": [],
1256+
"MethodInfo": "Microsoft.Azure.Cosmos.Fluent.VectorIndexDefinition`1[T] WithVectorIndexShardKey(System.String[]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
12521257
}
12531258
},
12541259
"NestedTypes": {}
@@ -1644,6 +1649,20 @@
16441649
],
16451650
"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;"
16461651
},
1652+
"System.String[] get_VectorIndexShardKey()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
1653+
"Type": "Method",
1654+
"Attributes": [
1655+
"CompilerGeneratedAttribute"
1656+
],
1657+
"MethodInfo": "System.String[] get_VectorIndexShardKey();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
1658+
},
1659+
"System.String[] VectorIndexShardKey[Newtonsoft.Json.JsonPropertyAttribute(NullValueHandling = 1, PropertyName = \"vectorIndexShardKey\")]": {
1660+
"Type": "Property",
1661+
"Attributes": [
1662+
"JsonPropertyAttribute"
1663+
],
1664+
"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;"
1665+
},
16471666
"Void set_IndexingSearchListSize(Int32)": {
16481667
"Type": "Method",
16491668
"Attributes": [],
@@ -1653,6 +1672,13 @@
16531672
"Type": "Method",
16541673
"Attributes": [],
16551674
"MethodInfo": "Void set_QuantizationByteSize(Int32);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
1675+
},
1676+
"Void set_VectorIndexShardKey(System.String[])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
1677+
"Type": "Method",
1678+
"Attributes": [
1679+
"CompilerGeneratedAttribute"
1680+
],
1681+
"MethodInfo": "Void set_VectorIndexShardKey(System.String[]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
16561682
}
16571683
},
16581684
"NestedTypes": {}

0 commit comments

Comments
 (0)