DataType
This enum specifies the data type of a collection field. Pass a DataType value when constructing a FieldSchema.
pub enum DataType {
Unknown,
Bool,
Int8,
Int16,
Int32,
Int64,
Float,
Double,
VarChar,
Json,
Geometry,
Timestamptz,
Array,
Struct,
FloatVector,
BinaryVector,
Float16Vector,
BFloat16Vector,
SparseFloatVector,
Int8Vector,
}
VARIANTS:
UnknownUnspecified or unrecognized field type. This is the default.
BoolBoolean value,
trueorfalse.Int88-bit signed integer.
Int1616-bit signed integer.
Int3232-bit signed integer.
Int6464-bit signed integer.
Float32-bit IEEE 754 floating-point number.
Double64-bit IEEE 754 floating-point number.
VarCharVariable-length UTF-8 string. Constrain its size with
max_length.JsonJSON document stored as-is.
GeometryGeometry value used by spatial queries (WKT-encoded).
TimestamptzTimestamp with timezone.
ArrayArray of scalar elements, all with the same element type.
StructNested struct of named sub-fields.
FloatVectorDense vector of 32-bit floats.
BinaryVectorDense binary vector stored as packed bytes.
Float16VectorDense vector of IEEE 754 half-precision floats.
BFloat16VectorDense vector of bfloat16 values.
SparseFloatVectorSparse vector stored as a map of dimension index to float value.
Int8VectorDense vector of 8-bit signed integers.
Example
let schema = CollectionSchema::new()
.add_field(FieldSchema::new().name("id").data_type(DataType::Int64).primary_key(true))
.add_field(FieldSchema::new().name("embedding").data_type(DataType::FloatVector).dimension(4));