Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrVectorIndexAlreadyExists = fmt.Errorf("vector index already exists") ErrVectorIndexNotFound = fmt.Errorf("vector index not found") )
Functions ¶
func AcceptNone ¶
AcceptNone implements SearchFilter by way of rejecting all results.
func BytesAsFloatArray ¶
BytesAsFloatArray(encoded) converts encoded into a []T, where T is either float32 or float64, depending on the value of floatBits. Let floatBytes = floatBits/8. If len(encoded) % floatBytes is not 0, it will ignore any trailing bytes, and simply convert floatBytes bytes at a time to generate the entries. The result is appended to the given retVal slice. If retVal is nil then a new slice is created and appended to.
func BytesToFloat ¶
Types ¶
type SearchFilter ¶
SearchFilter defines a predicate function that we will use to determine whether or not a given vector is "interesting". When used in the context of VectorIndex.Search, a true result means that we want to keep the result in the returned list, and a false result implies we should skip.
type SearchPathResult ¶
type SearchPathResult struct { // The collection of nearest-neighbors in sorted order after filtering // out neighbors that fail any Filter criteria. Neighbors []uint64 // The path from the start of search to the closest neighbor collections. Path []uint64 // A collection of captured named counters that occurred for the // particular search. Metrics map[string]uint64 }
SearchPathResult is the return-type for the optional SearchWithPath function for a VectorIndex (by way of extending OptionalIndexSupport).
func NewSearchPathResult ¶
func NewSearchPathResult() *SearchPathResult
NewSearchPathResult() provides an initialized (empty) *SearchPathResult. The attributes will be non-nil, but empty.