storobj

package
v1.24.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2024 License: BSD-3-Clause Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOwnership added in v1.19.0

func AddOwnership(objs []*Object, node, shard string)

func DocIDFromBinary

func DocIDFromBinary(in []byte) (uint64, error)

func NewErrNotFoundf

func NewErrNotFoundf(docID uint64, msg string, args ...interface{}) error

func ParseAndExtractBoolArrayProp added in v1.21.2

func ParseAndExtractBoolArrayProp(data []byte, propName string) ([]bool, bool, error)

func ParseAndExtractNumberArrayProp

func ParseAndExtractNumberArrayProp(data []byte, propName string) ([]float64, bool, error)

func ParseAndExtractProperty

func ParseAndExtractProperty(data []byte, propName string) ([]string, bool, error)

func ParseAndExtractTextProp

func ParseAndExtractTextProp(data []byte, propName string) ([]string, bool, error)

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 SearchResultsWithScore added in v1.24.5

func SearchResultsWithScore(in []*Object, scores []float32, additional additional.Properties, tenant string) 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

func VectorFromBinary

func VectorFromBinary(in []byte, buffer []float32, targetVector string) ([]float32, error)

Types

type ErrNotFound

type ErrNotFound struct {
	DocID       uint64
	OriginalMsg string
}

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:"-"`
	DocID             uint64
	Vectors           map[string][]float32 `json:"vectors"`
}

func FromBinary

func FromBinary(data []byte) (*Object, error)

func FromBinaryOptional

func FromBinaryOptional(data []byte,
	addProp additional.Properties,
) (*Object, error)

func FromBinaryUUIDOnly added in v1.18.1

func FromBinaryUUIDOnly(data []byte) (*Object, error)

func FromObject

func FromObject(object *models.Object, vector []float32, vectors models.Vectors) *Object

func New

func New(docID uint64) *Object

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) Class

func (ko *Object) Class() schema.ClassName

func (*Object) CreationTimeUnix

func (ko *Object) CreationTimeUnix() int64

func (*Object) DeepCopyDangerous

func (ko *Object) DeepCopyDangerous() *Object

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 (ko *Object) ExplainScore() string

func (*Object) GetDocID added in v1.24.0

func (ko *Object) GetDocID() uint64

func (*Object) ID

func (ko *Object) ID() strfmt.UUID

func (*Object) LastUpdateTimeUnix

func (ko *Object) LastUpdateTimeUnix() int64

func (*Object) MarshalBinary

func (ko *Object) MarshalBinary() ([]byte, error)

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) SearchResultWithScore added in v1.24.0

func (ko *Object) SearchResultWithScore(addl additional.Properties, score float32) search.Result

func (*Object) SearchResultWithScoreAndTenant added in v1.24.5

func (ko *Object) SearchResultWithScoreAndTenant(addl additional.Properties, score float32, tenant string) search.Result

func (*Object) SetClass

func (ko *Object) SetClass(class string)

func (*Object) SetDocID

func (ko *Object) SetDocID(id uint64)

func (*Object) SetID

func (ko *Object) SetID(id strfmt.UUID)

func (*Object) SetProperties

func (ko *Object) SetProperties(schema models.PropertySchema)

func (*Object) UnmarshalBinary

func (ko *Object) UnmarshalBinary(data []byte) error

UnmarshalBinary is the versioned way to unmarshal a kind object from binary, see MarshalBinary for the exact contents of each version

func (*Object) Valid

func (ko *Object) Valid() bool

func (*Object) VectorWeights

func (ko *Object) VectorWeights() models.VectorWeights

type Vectors added in v1.24.0

type Vectors map[string][]float32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL