Documentation ¶
Index ¶
- Constants
- func CollectionAutoCompactionEnabled(enabled bool) autoCompactionCollAttr
- func CollectionTTL(ttl int64) ttlCollAttr
- func DeserializeSliceSparseEmbedding(bs []byte) (sliceSparseEmbedding, error)
- func KvPairsMap(kvps []*commonpb.KeyValuePair) map[string]string
- func MapKvPairs(m map[string]string) []*commonpb.KeyValuePair
- type Alias
- type BFloat16Vector
- type BinaryVector
- type Collection
- type CollectionAttribute
- type CompactionState
- type ConsistencyLevel
- type Database
- type Field
- func (f *Field) GetDim() (int64, error)
- func (f *Field) ProtoMessage() *schemapb.FieldSchema
- func (f *Field) ReadProto(p *schemapb.FieldSchema) *Field
- func (f *Field) WithAnalyzerParams(params map[string]any) *Field
- func (f *Field) WithDataType(dataType FieldType) *Field
- func (f *Field) WithDefaultValueBool(defaultValue bool) *Field
- func (f *Field) WithDefaultValueDouble(defaultValue float64) *Field
- func (f *Field) WithDefaultValueFloat(defaultValue float32) *Field
- func (f *Field) WithDefaultValueInt(defaultValue int32) *Field
- func (f *Field) WithDefaultValueLong(defaultValue int64) *Field
- func (f *Field) WithDefaultValueString(defaultValue string) *Field
- func (f *Field) WithDescription(desc string) *Field
- func (f *Field) WithDim(dim int64) *Field
- func (f *Field) WithElementType(eleType FieldType) *Field
- func (f *Field) WithEnableAnalyzer(enable bool) *Field
- func (f *Field) WithIsAutoID(isAutoID bool) *Field
- func (f *Field) WithIsClusteringKey(isClusteringKey bool) *Field
- func (f *Field) WithIsDynamic(isDynamic bool) *Field
- func (f *Field) WithIsPartitionKey(isPartitionKey bool) *Field
- func (f *Field) WithIsPrimaryKey(isPrimaryKey bool) *Field
- func (f *Field) WithMaxCapacity(maxCap int64) *Field
- func (f *Field) WithMaxLength(maxLen int64) *Field
- func (f *Field) WithName(name string) *Field
- func (f *Field) WithNullable(nullable bool) *Field
- func (f *Field) WithTypeParams(key string, value string) *Field
- type FieldType
- type Float16Vector
- type FloatVector
- type Function
- func (f *Function) ProtoMessage() *schemapb.FunctionSchema
- func (f *Function) ReadProto(p *schemapb.FunctionSchema) *Function
- func (f *Function) WithInputFields(inputFields ...string) *Function
- func (f *Function) WithName(name string) *Function
- func (f *Function) WithOutputFields(outputFields ...string) *Function
- func (f *Function) WithParam(key string, value any) *Function
- func (f *Function) WithType(funcType FunctionType) *Function
- type FunctionType
- type GrantItem
- type LoadState
- type LoadStateCode
- type MetricType
- type Partition
- type PrivilegeGroup
- type RBACMeta
- type ReplicaGroup
- type Role
- type RoleGrants
- type Schema
- func (s *Schema) PKField() *Field
- func (s *Schema) PKFieldName() string
- func (s *Schema) ProtoMessage() *schemapb.CollectionSchema
- func (s *Schema) ReadProto(p *schemapb.CollectionSchema) *Schema
- func (s *Schema) WithAutoID(autoID bool) *Schema
- func (s *Schema) WithDescription(desc string) *Schema
- func (s *Schema) WithDynamicFieldEnabled(dynamicEnabled bool) *Schema
- func (s *Schema) WithField(f *Field) *Schema
- func (s *Schema) WithFunction(f *Function) *Schema
- func (s *Schema) WithName(name string) *Schema
- type Segment
- type ShardReplica
- type SparseEmbedding
- type Text
- type User
- type UserDescription
- type UserInfo
- type Vector
Constants ¶
const ( FunctionTypeUnknown = schemapb.FunctionType_Unknown FunctionTypeBM25 = schemapb.FunctionType_BM25 FunctionTypeTextEmbedding = schemapb.FunctionType_TextEmbedding )
provide package alias
const ( // TypeParamDim is the const for field type param dimension TypeParamDim = "dim" // TypeParamMaxLength is the const for varchar type maximal length TypeParamMaxLength = "max_length" // TypeParamMaxCapacity is the const for array type max capacity TypeParamMaxCapacity = `max_capacity` // ClStrong strong consistency level ClStrong ConsistencyLevel = ConsistencyLevel(commonpb.ConsistencyLevel_Strong) // ClBounded bounded consistency level with default tolerance of 5 seconds ClBounded ConsistencyLevel = ConsistencyLevel(commonpb.ConsistencyLevel_Bounded) // ClSession session consistency level ClSession ConsistencyLevel = ConsistencyLevel(commonpb.ConsistencyLevel_Session) // ClEvenually eventually consistency level ClEventually ConsistencyLevel = ConsistencyLevel(commonpb.ConsistencyLevel_Eventually) // ClCustomized customized consistency level and users pass their own `guarantee_timestamp`. ClCustomized ConsistencyLevel = ConsistencyLevel(commonpb.ConsistencyLevel_Customized) )
const DefaultShardNumber int32 = 0
DefaultShardNumber const value for using Milvus default shard number.
Variables ¶
This section is empty.
Functions ¶
func CollectionAutoCompactionEnabled ¶
func CollectionAutoCompactionEnabled(enabled bool) autoCompactionCollAttr
CollectionAutoCompactionEnabled returns collection attribute to set collection auto compaction enabled.
func CollectionTTL ¶
func CollectionTTL(ttl int64) ttlCollAttr
CollectionTTL returns collection attribute to set collection ttl in seconds.
func KvPairsMap ¶
func KvPairsMap(kvps []*commonpb.KeyValuePair) map[string]string
KvPairsMap converts commonpb.KeyValuePair slices into map
func MapKvPairs ¶
func MapKvPairs(m map[string]string) []*commonpb.KeyValuePair
MapKvPairs converts map into commonpb.KeyValuePair slice
Types ¶
type BFloat16Vector ¶
type BFloat16Vector []byte
FloatVector float32 vector wrapper.
func (BFloat16Vector) FieldType ¶
func (fv BFloat16Vector) FieldType() FieldType
entity.FieldType returns coresponding field type.
func (BFloat16Vector) Serialize ¶
func (fv BFloat16Vector) Serialize() []byte
func (BFloat16Vector) ToFloat32Vector ¶
func (fv BFloat16Vector) ToFloat32Vector() FloatVector
type BinaryVector ¶
type BinaryVector []byte
BinaryVector []byte vector wrapper
func (BinaryVector) Dim ¶
func (bv BinaryVector) Dim() int
Dim return vector dimension, note that binary vector is bits count
func (BinaryVector) FieldType ¶
func (bv BinaryVector) FieldType() FieldType
entity.FieldType returns coresponding field type.
func (BinaryVector) Serialize ¶
func (bv BinaryVector) Serialize() []byte
Serialize just return bytes
type Collection ¶
type Collection struct { ID int64 // collection id Name string // collection name Schema *Schema // collection schema, with fields schema and primary key definition PhysicalChannels []string VirtualChannels []string Loaded bool ConsistencyLevel ConsistencyLevel ShardNum int32 Properties map[string]string }
Collection represent collection meta in Milvus
type CollectionAttribute ¶
CollectionAttribute is the interface for altering collection attributes.
type CompactionState ¶
type CompactionState commonpb.CompactionState
CompactionState enum type for compaction state
const ( CompactionStateRunning CompactionState = CompactionState(commonpb.CompactionState_Executing) CompactionStateCompleted CompactionState = CompactionState(commonpb.CompactionState_Completed) )
CompactionState Constants
type ConsistencyLevel ¶
type ConsistencyLevel commonpb.ConsistencyLevel
ConsistencyLevel enum type for collection Consistency Level
const DefaultConsistencyLevel ConsistencyLevel = ClBounded
DefaultConsistencyLevel const value for using Milvus default consistency level setting.
func (ConsistencyLevel) CommonConsistencyLevel ¶
func (cl ConsistencyLevel) CommonConsistencyLevel() commonpb.ConsistencyLevel
CommonConsistencyLevel returns corresponding commonpb.ConsistencyLevel
type Field ¶
type Field struct { ID int64 // field id, generated when collection is created, input value is ignored Name string // field name PrimaryKey bool // is primary key AutoID bool // is auto id Description string DataType FieldType TypeParams map[string]string IndexParams map[string]string IsDynamic bool IsPartitionKey bool IsClusteringKey bool ElementType FieldType DefaultValue *schemapb.ValueField Nullable bool }
Field represent field schema in milvus
func (*Field) ProtoMessage ¶
func (f *Field) ProtoMessage() *schemapb.FieldSchema
ProtoMessage generates corresponding FieldSchema
func (*Field) ReadProto ¶
func (f *Field) ReadProto(p *schemapb.FieldSchema) *Field
ReadProto parses FieldSchema
func (*Field) WithDataType ¶
func (*Field) WithDefaultValueBool ¶
func (*Field) WithDefaultValueDouble ¶
func (*Field) WithDefaultValueFloat ¶
func (*Field) WithDefaultValueInt ¶
func (*Field) WithDefaultValueLong ¶
func (*Field) WithDefaultValueString ¶
func (*Field) WithDescription ¶
func (*Field) WithElementType ¶
func (*Field) WithEnableAnalyzer ¶
func (*Field) WithIsAutoID ¶
func (*Field) WithIsClusteringKey ¶
func (*Field) WithIsDynamic ¶
func (*Field) WithIsPartitionKey ¶
func (*Field) WithIsPrimaryKey ¶
func (*Field) WithMaxCapacity ¶
func (*Field) WithMaxLength ¶
func (*Field) WithNullable ¶
type FieldType ¶
type FieldType int32
FieldType field data type alias type used in go:generate trick, DO NOT modify names & string
const ( // FieldTypeNone zero value place holder FieldTypeNone FieldType = 0 // zero value place holder // FieldTypeBool field type boolean FieldTypeBool FieldType = 1 // FieldTypeInt8 field type int8 FieldTypeInt8 FieldType = 2 // FieldTypeInt16 field type int16 FieldTypeInt16 FieldType = 3 // FieldTypeInt32 field type int32 FieldTypeInt32 FieldType = 4 // FieldTypeInt64 field type int64 FieldTypeInt64 FieldType = 5 // FieldTypeFloat field type float FieldTypeFloat FieldType = 10 // FieldTypeDouble field type double FieldTypeDouble FieldType = 11 // FieldTypeString field type string FieldTypeString FieldType = 20 // FieldTypeVarChar field type varchar FieldTypeVarChar FieldType = 21 // variable-length strings with a specified maximum length // FieldTypeArray field type Array FieldTypeArray FieldType = 22 // FieldTypeJSON field type JSON FieldTypeJSON FieldType = 23 // FieldTypeBinaryVector field type binary vector FieldTypeBinaryVector FieldType = 100 // FieldTypeFloatVector field type float vector FieldTypeFloatVector FieldType = 101 // FieldTypeBinaryVector field type float16 vector FieldTypeFloat16Vector FieldType = 102 // FieldTypeBinaryVector field type bf16 vector FieldTypeBFloat16Vector FieldType = 103 // FieldTypeBinaryVector field type sparse vector FieldTypeSparseVector FieldType = 104 )
Match schema definition
func (FieldType) PbFieldType ¶
PbFieldType represents FieldType corresponding schema pb type
type Float16Vector ¶
type Float16Vector []byte
FloatVector float32 vector wrapper.
func (Float16Vector) FieldType ¶
func (fv Float16Vector) FieldType() FieldType
entity.FieldType returns coresponding field type.
func (Float16Vector) Serialize ¶
func (fv Float16Vector) Serialize() []byte
func (Float16Vector) ToFloat32Vector ¶
func (fv Float16Vector) ToFloat32Vector() FloatVector
type FloatVector ¶
type FloatVector []float32
FloatVector float32 vector wrapper.
func (FloatVector) FieldType ¶
func (fv FloatVector) FieldType() FieldType
entity.FieldType returns coresponding field type.
func (FloatVector) Serialize ¶
func (fv FloatVector) Serialize() []byte
Serialize serializes vector into byte slice, used in search placeholder LittleEndian is used for convention
func (FloatVector) ToBFloat16Vector ¶
func (fv FloatVector) ToBFloat16Vector() BFloat16Vector
SerializeToBFloat16Bytes serializes vector into bfloat16 byte slice, used in search placeholder
func (FloatVector) ToFloat16Vector ¶
func (fv FloatVector) ToFloat16Vector() Float16Vector
type Function ¶
type Function struct { Name string Description string Type FunctionType InputFieldNames []string OutputFieldNames []string Params map[string]string // contains filtered or unexported fields }
func NewFunction ¶
func NewFunction() *Function
func (*Function) ProtoMessage ¶
func (f *Function) ProtoMessage() *schemapb.FunctionSchema
ProtoMessage returns corresponding schemapb.FunctionSchema
func (*Function) ReadProto ¶
func (f *Function) ReadProto(p *schemapb.FunctionSchema) *Function
ReadProto parses proto Collection Schema
func (*Function) WithInputFields ¶
func (*Function) WithOutputFields ¶
func (*Function) WithType ¶
func (f *Function) WithType(funcType FunctionType) *Function
type FunctionType ¶
type FunctionType = schemapb.FunctionType
type LoadState ¶
type LoadState struct { State LoadStateCode Progress int64 }
type LoadStateCode ¶
const ( // LoadStateNone LoadStateCode = LoadStateCode(commonpb.LoadState) LoadStateLoading LoadStateCode = LoadStateCode(commonpb.LoadState_LoadStateLoading) LoadStateLoaded LoadStateCode = LoadStateCode(commonpb.LoadState_LoadStateLoaded) LoadStateUnloading LoadStateCode = LoadStateCode(commonpb.LoadState_LoadStateNotExist) LoadStateNotLoad LoadStateCode = LoadStateCode(commonpb.LoadState_LoadStateNotLoad) )
type MetricType ¶
type MetricType string
MetricType metric type
const ( L2 MetricType = "L2" IP MetricType = "IP" COSINE MetricType = "COSINE" HAMMING MetricType = "HAMMING" JACCARD MetricType = "JACCARD" TANIMOTO MetricType = "TANIMOTO" SUBSTRUCTURE MetricType = "SUBSTRUCTURE" SUPERSTRUCTURE MetricType = "SUPERSTRUCTURE" BM25 MetricType = "BM25" )
Metric Constants
type Partition ¶
type Partition struct { ID int64 // partition id Name string // partition name Loaded bool // partition loaded }
Partition represent partition meta in Milvus
type PrivilegeGroup ¶
PrivilegeGroup is the entity model for custom privilege group.
type RBACMeta ¶
type RBACMeta struct { Users []*UserInfo Roles []*Role RoleGrants []*RoleGrants PrivilegeGroups []*PrivilegeGroup }
type ReplicaGroup ¶
type ReplicaGroup struct { ReplicaID int64 NodeIDs []int64 ShardReplicas []*ShardReplica }
ReplicaGroup represents a replica group
type RoleGrants ¶
type RoleGrants struct { Object string ObjectName string RoleName string GrantorName string PrivilegeName string DbName string }
RoleGrants is the model for RBAC role description object.
type Schema ¶
type Schema struct { CollectionName string Description string AutoID bool Fields []*Field EnableDynamicField bool Functions []*Function // contains filtered or unexported fields }
Schema represents schema info of collection in milvus
func (*Schema) PKFieldName ¶
PKFieldName returns pk field name for this schemapb.
func (*Schema) ProtoMessage ¶
func (s *Schema) ProtoMessage() *schemapb.CollectionSchema
ProtoMessage returns corresponding server.CollectionSchema
func (*Schema) ReadProto ¶
func (s *Schema) ReadProto(p *schemapb.CollectionSchema) *Schema
ReadProto parses proto Collection Schema
func (*Schema) WithAutoID ¶
func (*Schema) WithDescription ¶
WithDescription sets the description value of schema, returns schema itself.
func (*Schema) WithDynamicFieldEnabled ¶
func (*Schema) WithFunction ¶
type Segment ¶
type Segment struct { ID int64 CollectionID int64 ParititionID int64 NumRows int64 State commonpb.SegmentState }
Segment represent segment in milvus
type ShardReplica ¶
ShardReplica represents a shard in the ReplicaGroup
type SparseEmbedding ¶
type SparseEmbedding interface { Dim() int // the dimension Len() int // the actual items in this vector Get(idx int) (pos uint32, value float32, ok bool) Serialize() []byte FieldType() FieldType }
func NewSliceSparseEmbedding ¶
func NewSliceSparseEmbedding(positions []uint32, values []float32) (SparseEmbedding, error)
type Text ¶
type Text string
type UserDescription ¶
UserDescription is the model for RBAC user description object.
type UserInfo ¶
type UserInfo struct { UserDescription Password string }