Skip to main content

FieldType

A FieldType instance enumerates supported Milvus field data types and provides helpers for identifying vector types.

Notes

IsVectorType() returns true for binary, float, float16, bfloat16, sparse, and int8 vector field types.

Notes

FieldTypeText is a variable-length string type that does not require a max_length.

go
type FieldType int32

VALUES:

  • FieldTypeNone = 0

    zero value place holder.

  • FieldTypeBool = 1

  • FieldTypeInt8 = 2

  • FieldTypeInt16 = 3

  • FieldTypeInt32 = 4

  • FieldTypeInt64 = 5

  • FieldTypeFloat = 10

  • FieldTypeDouble = 11

  • FieldTypeString = 20

  • FieldTypeVarChar = 21

    variable-length strings with a specified maximum length.

  • FieldTypeArray = 22

  • FieldTypeJSON = 23

  • FieldTypeGeometry = 24

  • FieldTypeText = 25

    variable-length strings without a required max_length.

  • FieldTypeTimestamptz = 26

  • FieldTypeBinaryVector = 100

  • FieldTypeFloatVector = 101

  • FieldTypeFloat16Vector = 102

  • FieldTypeBFloat16Vector = 103

  • FieldTypeSparseVector = 104

  • FieldTypeInt8Vector = 105

  • FieldTypeStruct = 201

Example​

Demonstrates FieldType usage.

go
import (
"fmt"

"github.com/milvus-io/milvus/client/v3/entity"
)

fieldType := entity.FieldTypeFloatVector
fmt.Println(fieldType.Name())
fmt.Println(fieldType.IsVectorType())
Minimum SDK versionv3.0.x
Was this page helpful?