Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Dimension type from long to int #34

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Milvus.Client/FieldSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static FieldSchema CreateVarchar(
/// <param name="name">The field name.</param>
/// <param name="dimension">The dimension of the vector. Must be greater than zero.</param>
/// <param name="description">An optional description for the field.</param>
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 };

/// <summary>
Expand All @@ -85,7 +85,7 @@ public static FieldSchema CreateFloatVector(string name, long dimension, string
/// <param name="name">The field name.</param>
/// <param name="dimension">The dimension of the vector. Must be greater than zero.</param>
/// <param name="description">An optional description for the field.</param>
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 };

/// <summary>
Expand Down Expand Up @@ -191,7 +191,7 @@ internal FieldSchema(
/// The dimension of the vector. Mandatory for <see cref="MilvusDataType.FloatVector" />
/// and <see cref="MilvusDataType.BinaryVector" /> fields, and must be greater than zero.
/// </summary>
public long? Dimension { get; set; }
public int? Dimension { get; set; }

/// <summary>
/// The state of the field.
Expand Down
2 changes: 1 addition & 1 deletion Milvus.Client/MilvusCollection.Collection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down