From 002fb6cba52b9bc6a1f83070d89bba9e2bf8f82b Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Sat, 2 Sep 2023 11:00:58 +0200 Subject: [PATCH] Change Dimension type from long to int --- Milvus.Client/FieldSchema.cs | 6 +++--- Milvus.Client/MilvusCollection.Collection.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Milvus.Client/FieldSchema.cs b/Milvus.Client/FieldSchema.cs index 4efd6d2..0c9720b 100644 --- a/Milvus.Client/FieldSchema.cs +++ b/Milvus.Client/FieldSchema.cs @@ -76,7 +76,7 @@ public static FieldSchema CreateVarchar( /// The field name. /// The dimension of the vector. Must be greater than zero. /// An optional description for the field. - public static FieldSchema CreateFloatVector(string name, long dimension, string description = "") + public static FieldSchema CreateFloatVector(string name, int dimension, string description = "") => new(name, MilvusDataType.FloatVector, description: description) { Dimension = dimension }; /// @@ -85,7 +85,7 @@ public static FieldSchema CreateFloatVector(string name, long dimension, string /// The field name. /// The dimension of the vector. Must be greater than zero. /// An optional description for the field. - public static FieldSchema CreateBinaryVector(string name, long dimension, string description = "") + public static FieldSchema CreateBinaryVector(string name, int dimension, string description = "") => new(name, MilvusDataType.BinaryVector, description: description) { Dimension = dimension }; /// @@ -191,7 +191,7 @@ internal FieldSchema( /// The dimension of the vector. Mandatory for /// and fields, and must be greater than zero. /// - public long? Dimension { get; set; } + public int? Dimension { get; set; } /// /// The state of the field. diff --git a/Milvus.Client/MilvusCollection.Collection.cs b/Milvus.Client/MilvusCollection.Collection.cs index 2ca2a12..057aba7 100644 --- a/Milvus.Client/MilvusCollection.Collection.cs +++ b/Milvus.Client/MilvusCollection.Collection.cs @@ -46,7 +46,7 @@ await _client.InvokeAsync(_client.GrpcClient.DescribeCollectionAsync, request, r break; case Constants.VectorDim: - milvusField.Dimension = long.Parse(parameter.Value, CultureInfo.InvariantCulture); + milvusField.Dimension = int.Parse(parameter.Value, CultureInfo.InvariantCulture); break; } }