Documentation ¶
Index ¶
- func AddOwnership(objs []*Object, node, shard string)
- func DocIDFromBinary(in []byte) (uint64, error)
- func NewErrNotFoundf(docID uint64, msg string, args ...interface{}) error
- func ParseAndExtractBoolArrayProp(data []byte, propName string) ([]bool, bool, error)
- func ParseAndExtractNumberArrayProp(data []byte, propName string) ([]float64, bool, error)
- func ParseAndExtractProperty(data []byte, propName string) ([]string, bool, error)
- func ParseAndExtractTextProp(data []byte, propName string) ([]string, bool, error)
- func SearchResults(in []*Object, additional additional.Properties, tenant string) search.Results
- func SearchResultsWithDists(in []*Object, addl additional.Properties, dists []float32) search.Results
- func UnmarshalPropertiesFromObject(data []byte, properties *map[string]interface{}, ...) error
- func VectorFromBinary(in []byte, buffer []float32) ([]float32, error)
- type ErrNotFound
- type Object
- func FromBinary(data []byte) (*Object, error)
- func FromBinaryOptional(data []byte, addProp additional.Properties) (*Object, error)
- func FromBinaryUUIDOnly(data []byte) (*Object, error)
- func FromObject(object *models.Object, vector []float32) *Object
- func New(docID uint64) *Object
- func ObjectsByDocID(bucket bucket, ids []uint64, additional additional.Properties) ([]*Object, error)
- func (ko *Object) AdditionalProperties() models.AdditionalProperties
- func (ko *Object) Class() schema.ClassName
- func (ko *Object) CreationTimeUnix() int64
- func (ko *Object) DeepCopyDangerous() *Object
- func (ko *Object) DocID() uint64
- func (ko *Object) ExplainScore() string
- func (ko *Object) ID() strfmt.UUID
- func (ko *Object) LastUpdateTimeUnix() int64
- func (ko *Object) MarshalBinary() ([]byte, error)
- func (ko *Object) Properties() models.PropertySchema
- func (ko *Object) PropertiesWithAdditional(additional additional.Properties) models.PropertySchema
- func (ko *Object) Score() float32
- func (ko *Object) SearchResult(additional additional.Properties, tenant string) *search.Result
- func (ko *Object) SearchResultWithDist(addl additional.Properties, dist float32) search.Result
- func (ko *Object) SetClass(class string)
- func (ko *Object) SetDocID(id uint64)
- func (ko *Object) SetID(id strfmt.UUID)
- func (ko *Object) SetProperties(schema models.PropertySchema)
- func (ko *Object) UnmarshalBinary(data []byte) error
- func (ko *Object) Valid() bool
- func (ko *Object) VectorWeights() models.VectorWeights
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOwnership ¶ added in v1.19.0
func DocIDFromBinary ¶
func NewErrNotFoundf ¶
func ParseAndExtractBoolArrayProp ¶ added in v1.21.2
func ParseAndExtractProperty ¶
func ParseAndExtractTextProp ¶
func SearchResults ¶
func SearchResults(in []*Object, additional additional.Properties, tenant string) search.Results
func SearchResultsWithDists ¶
func SearchResultsWithDists(in []*Object, addl additional.Properties, dists []float32, ) search.Results
func UnmarshalPropertiesFromObject ¶
func UnmarshalPropertiesFromObject(data []byte, properties *map[string]interface{}, aggregationProperties []string, propStrings [][]string) error
UnmarshalPropertiesFromObject only unmarshals and returns the properties part of the object
Check MarshalBinary for the order of elements in the input array
Types ¶
type ErrNotFound ¶
func (ErrNotFound) Error ¶
func (err ErrNotFound) Error() string
type Object ¶
type Object struct { MarshallerVersion uint8 Object models.Object `json:"object"` Vector []float32 `json:"vector"` VectorLen int `json:"-"` BelongsToNode string `json:"-"` BelongsToShard string `json:"-"` IsConsistent bool `json:"-"` // contains filtered or unexported fields }
func FromBinary ¶
func FromBinaryOptional ¶
func FromBinaryOptional(data []byte, addProp additional.Properties, ) (*Object, error)
func FromBinaryUUIDOnly ¶ added in v1.18.1
func ObjectsByDocID ¶
func ObjectsByDocID(bucket bucket, ids []uint64, additional additional.Properties, ) ([]*Object, error)
func (*Object) AdditionalProperties ¶
func (ko *Object) AdditionalProperties() models.AdditionalProperties
AdditionalProperties groups all properties which are stored with the object and not generated at runtime
func (*Object) CreationTimeUnix ¶
func (*Object) DeepCopyDangerous ¶
DeepCopyDangerous creates a deep copy of the underlying Object WARNING: This was purpose built for the batch ref usecase and only covers the situations that are required there. This means that cases which aren't reflected in that usecase may still contain references. Thus the suffix "Dangerous". If needed, make sure everything is copied and remove the suffix.
func (*Object) ExplainScore ¶
func (*Object) LastUpdateTimeUnix ¶
func (*Object) MarshalBinary ¶
MarshalBinary creates the binary representation of a kind object. Regardless of the marshaller version the first byte is a uint8 indicating the version followed by the payload which depends on the specific version
Version 1 No. of B | Type | Content ------------------------------------------------ 1 | uint8 | MarshallerVersion = 1 8 | uint64 | index id, keep early so id-only lookups are maximum efficient 1 | uint8 | kind, 0=action, 1=thing - deprecated 16 | uint128 | uuid 8 | int64 | create time 8 | int64 | update time 2 | uint16 | VectorLength n*4 | []float32 | vector of length n 2 | uint16 | length of class name n | []byte | className 4 | uint32 | length of schema json n | []byte | schema as json 2 | uint32 | length of meta json n | []byte | meta as json 2 | uint32 | length of vectorweights json n | []byte | vectorweights as json
func (*Object) Properties ¶
func (ko *Object) Properties() models.PropertySchema
func (*Object) PropertiesWithAdditional ¶
func (ko *Object) PropertiesWithAdditional( additional additional.Properties, ) models.PropertySchema
func (*Object) SearchResult ¶
func (ko *Object) SearchResult(additional additional.Properties, tenant string) *search.Result
func (*Object) SearchResultWithDist ¶
func (ko *Object) SearchResultWithDist(addl additional.Properties, dist float32) search.Result
func (*Object) SetProperties ¶
func (ko *Object) SetProperties(schema models.PropertySchema)
func (*Object) UnmarshalBinary ¶
UnmarshalBinary is the versioned way to unmarshal a kind object from binary, see MarshalBinary for the exact contents of each version
func (*Object) VectorWeights ¶
func (ko *Object) VectorWeights() models.VectorWeights