diff --git a/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs b/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs index c8926258bd3c..5f90f3ed9e3e 100644 --- a/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs +++ b/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs @@ -23,7 +23,6 @@ internal class MongoModelBuilder() : CollectionModelBuilder(s_validationOptions) private static readonly CollectionModelBuildingOptions s_validationOptions = new() { RequiresAtLeastOneVector = false, - SupportsMultipleKeys = false, SupportsMultipleVectors = true, UsesExternalSerializer = true, }; diff --git a/dotnet/src/VectorData/AzureAISearch/AzureAISearchDynamicModelBuilder.cs b/dotnet/src/VectorData/AzureAISearch/AzureAISearchDynamicModelBuilder.cs index d0689c9b9089..34b02f7ae58f 100644 --- a/dotnet/src/VectorData/AzureAISearch/AzureAISearchDynamicModelBuilder.cs +++ b/dotnet/src/VectorData/AzureAISearch/AzureAISearchDynamicModelBuilder.cs @@ -12,7 +12,6 @@ internal class AzureAISearchDynamicModelBuilder() : CollectionModelBuilder(s_mod internal static readonly CollectionModelBuildingOptions s_modelBuildingOptions = new() { RequiresAtLeastOneVector = false, - SupportsMultipleKeys = false, SupportsMultipleVectors = true, UsesExternalSerializer = true }; diff --git a/dotnet/src/VectorData/AzureAISearch/AzureAISearchModelBuilder.cs b/dotnet/src/VectorData/AzureAISearch/AzureAISearchModelBuilder.cs index 31f90d77dd3c..1d7bb64f184e 100644 --- a/dotnet/src/VectorData/AzureAISearch/AzureAISearchModelBuilder.cs +++ b/dotnet/src/VectorData/AzureAISearch/AzureAISearchModelBuilder.cs @@ -16,7 +16,6 @@ internal class AzureAISearchModelBuilder() : CollectionJsonModelBuilder(s_modelB internal static readonly CollectionModelBuildingOptions s_modelBuildingOptions = new() { RequiresAtLeastOneVector = false, - SupportsMultipleKeys = false, SupportsMultipleVectors = true, UsesExternalSerializer = true }; diff --git a/dotnet/src/VectorData/CosmosNoSql/CosmosNoSqlModelBuilder.cs b/dotnet/src/VectorData/CosmosNoSql/CosmosNoSqlModelBuilder.cs index fcbd60877571..6ece1dea9dcb 100644 --- a/dotnet/src/VectorData/CosmosNoSql/CosmosNoSqlModelBuilder.cs +++ b/dotnet/src/VectorData/CosmosNoSql/CosmosNoSqlModelBuilder.cs @@ -15,7 +15,6 @@ internal class CosmosNoSqlModelBuilder() : CollectionJsonModelBuilder(s_modelBui private static readonly CollectionModelBuildingOptions s_modelBuildingOptions = new() { RequiresAtLeastOneVector = false, - SupportsMultipleKeys = false, SupportsMultipleVectors = true, UsesExternalSerializer = true, ReservedKeyStorageName = CosmosNoSqlConstants.ReservedKeyPropertyName diff --git a/dotnet/src/VectorData/InMemory/InMemoryModelBuilder.cs b/dotnet/src/VectorData/InMemory/InMemoryModelBuilder.cs index aab0cb1c5d10..817490611f46 100644 --- a/dotnet/src/VectorData/InMemory/InMemoryModelBuilder.cs +++ b/dotnet/src/VectorData/InMemory/InMemoryModelBuilder.cs @@ -14,7 +14,6 @@ internal class InMemoryModelBuilder() : CollectionModelBuilder(ValidationOptions internal static readonly CollectionModelBuildingOptions ValidationOptions = new() { RequiresAtLeastOneVector = false, - SupportsMultipleKeys = false, SupportsMultipleVectors = true }; diff --git a/dotnet/src/VectorData/PgVector/PostgresModelBuilder.cs b/dotnet/src/VectorData/PgVector/PostgresModelBuilder.cs index 5b87dbe02d04..19671d6c9b57 100644 --- a/dotnet/src/VectorData/PgVector/PostgresModelBuilder.cs +++ b/dotnet/src/VectorData/PgVector/PostgresModelBuilder.cs @@ -18,7 +18,6 @@ internal class PostgresModelBuilder() : CollectionModelBuilder(PostgresModelBuil public static readonly CollectionModelBuildingOptions ModelBuildingOptions = new() { RequiresAtLeastOneVector = false, - SupportsMultipleKeys = false, SupportsMultipleVectors = true, }; diff --git a/dotnet/src/VectorData/Pinecone/PineconeModelBuilder.cs b/dotnet/src/VectorData/Pinecone/PineconeModelBuilder.cs index e71b9effd0f0..fd0565fc72ce 100644 --- a/dotnet/src/VectorData/Pinecone/PineconeModelBuilder.cs +++ b/dotnet/src/VectorData/Pinecone/PineconeModelBuilder.cs @@ -15,7 +15,6 @@ internal class PineconeModelBuilder() : CollectionModelBuilder(s_validationOptio private static readonly CollectionModelBuildingOptions s_validationOptions = new() { RequiresAtLeastOneVector = true, - SupportsMultipleKeys = false, SupportsMultipleVectors = false, }; diff --git a/dotnet/src/VectorData/Qdrant/QdrantModelBuilder.cs b/dotnet/src/VectorData/Qdrant/QdrantModelBuilder.cs index a290c303b85e..a4bf583d08ed 100644 --- a/dotnet/src/VectorData/Qdrant/QdrantModelBuilder.cs +++ b/dotnet/src/VectorData/Qdrant/QdrantModelBuilder.cs @@ -16,7 +16,6 @@ private static CollectionModelBuildingOptions GetModelBuildOptions(bool hasNamed => new() { RequiresAtLeastOneVector = !hasNamedVectors, - SupportsMultipleKeys = false, SupportsMultipleVectors = hasNamedVectors, }; diff --git a/dotnet/src/VectorData/Redis/RedisHashSetCollection.cs b/dotnet/src/VectorData/Redis/RedisHashSetCollection.cs index b34e50234049..42e4b8b7e63b 100644 --- a/dotnet/src/VectorData/Redis/RedisHashSetCollection.cs +++ b/dotnet/src/VectorData/Redis/RedisHashSetCollection.cs @@ -36,7 +36,6 @@ public class RedisHashSetCollection : VectorStoreCollection : VectorStoreCollection /// Returns the single key property in the model, and throws if there are multiple key properties. - /// Suitable for connectors where validation is in place for single keys only (). /// public KeyPropertyModel KeyProperty => this._singleKeyProperty ??= this.KeyProperties.Single(); diff --git a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuilder.cs b/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuilder.cs index de8456e70fb4..03dcb9d48e9a 100644 --- a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuilder.cs +++ b/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuilder.cs @@ -57,14 +57,7 @@ public abstract class CollectionModelBuilder /// Constructs a new . /// protected CollectionModelBuilder(CollectionModelBuildingOptions options) - { - if (options.SupportsMultipleKeys && options.ReservedKeyStorageName is not null) - { - throw new ArgumentException($"{nameof(CollectionModelBuildingOptions.ReservedKeyStorageName)} cannot be set when {nameof(CollectionModelBuildingOptions.SupportsMultipleKeys)} is set."); - } - - this.Options = options; - } + => this.Options = options; /// /// Builds and returns an from the given and . @@ -419,7 +412,7 @@ protected virtual void Customize() /// protected virtual void Validate(Type? type, VectorStoreCollectionDefinition? definition) { - if (!this.Options.SupportsMultipleKeys && this.KeyProperties.Count > 1) + if (this.KeyProperties.Count > 1) { throw new NotSupportedException($"Multiple key properties found on {TypeMessage()}the provided {nameof(VectorStoreCollectionDefinition)} while only one is supported."); } diff --git a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuildingOptions.cs b/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuildingOptions.cs index 3fe17a327b70..28ae1f026af0 100644 --- a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuildingOptions.cs +++ b/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuildingOptions.cs @@ -11,11 +11,6 @@ namespace Microsoft.Extensions.VectorData.ProviderServices; [Experimental("MEVD9001")] public sealed class CollectionModelBuildingOptions { - /// - /// Gets a value that indicates whether multiple key properties are supported. - /// - public required bool SupportsMultipleKeys { get; init; } - /// /// Gets a value that indicates whether multiple vector properties are supported. /// diff --git a/dotnet/src/VectorData/Weaviate/WeaviateModelBuilder.cs b/dotnet/src/VectorData/Weaviate/WeaviateModelBuilder.cs index 9a1f429849de..c535ede3cb0d 100644 --- a/dotnet/src/VectorData/Weaviate/WeaviateModelBuilder.cs +++ b/dotnet/src/VectorData/Weaviate/WeaviateModelBuilder.cs @@ -18,7 +18,6 @@ private static CollectionModelBuildingOptions GetModelBuildingOptions(bool hasNa return new() { RequiresAtLeastOneVector = !hasNamedVectors, - SupportsMultipleKeys = false, SupportsMultipleVectors = hasNamedVectors }; } diff --git a/dotnet/test/VectorData/VectorData.UnitTests/CollectionModelBuilderTests.cs b/dotnet/test/VectorData/VectorData.UnitTests/CollectionModelBuilderTests.cs index 0bc26fea1ef5..1fb1961e7883 100644 --- a/dotnet/test/VectorData/VectorData.UnitTests/CollectionModelBuilderTests.cs +++ b/dotnet/test/VectorData/VectorData.UnitTests/CollectionModelBuilderTests.cs @@ -368,7 +368,6 @@ private sealed class CustomModelBuilder(CollectionModelBuildingOptions? options { private static readonly CollectionModelBuildingOptions s_defaultOptions = new() { - SupportsMultipleKeys = false, SupportsMultipleVectors = true, RequiresAtLeastOneVector = false };