Documentation
¶
Index ¶
- Constants
- func AddVectorsToIndex(ctx context.Context, vectors []VectorRecord, vectorIndex VectorIndex) error
- func CalculateOptimalSegments(dims int) int
- func MultiVectorsEqual(vecA, vecB [][]float32) bool
- func VectorsEqual(vecA, vecB []float32) bool
- type IndexStats
- type IndexType
- type Iterator
- type MultiVectorForID
- type MultipleVectorForID
- type PqMaxPool
- type QueryVectorDistancer
- type SearchByDistParams
- func (params *SearchByDistParams) Iterate()
- func (params *SearchByDistParams) MaxLimitReached() bool
- func (params *SearchByDistParams) MaximumSearchLimit() int64
- func (params *SearchByDistParams) OffsetCapacity(ids []uint64) int
- func (params *SearchByDistParams) TotalLimit() int
- func (params *SearchByDistParams) TotalLimitCapacity(ids []uint64) int
- type ShardedLocks
- type ShardedRWLocks
- func (sl *ShardedRWLocks) Lock(id uint64)
- func (sl *ShardedRWLocks) LockAll()
- func (sl *ShardedRWLocks) Locked(id uint64, callback func())
- func (sl *ShardedRWLocks) LockedAll(callback func())
- func (sl *ShardedRWLocks) RLock(id uint64)
- func (sl *ShardedRWLocks) RLockAll()
- func (sl *ShardedRWLocks) RLocked(id uint64, callback func())
- func (sl *ShardedRWLocks) RLockedAll(callback func())
- func (sl *ShardedRWLocks) RUnlock(id uint64)
- func (sl *ShardedRWLocks) RUnlockAll()
- func (sl *ShardedRWLocks) Unlock(id uint64)
- func (sl *ShardedRWLocks) UnlockAll()
- type SharedGauge
- type SparseFisherYatesIterator
- type TargetTempVectorForID
- type TargetVectorForID
- type TempVectorForID
- type TempVectorUint64Pool
- type TempVectorsPool
- type Vector
- type VectorForID
- type VectorIndex
- type VectorRecord
- type VectorSlice
- type VectorUint64Slice
Constants ¶
View Source
const ( IndexTypeHNSW = "hnsw" IndexTypeFlat = "flat" IndexTypeNoop = "noop" IndexTypeDynamic = "dynamic" )
View Source
const ( // DefaultSearchByDistInitialLimit : // the initial limit of 100 here is an // arbitrary decision, and can be tuned // as needed DefaultSearchByDistInitialLimit = 100 // DefaultSearchByDistLimitMultiplier : // the decision to increase the limit in // multiples of 10 here is an arbitrary // decision, and can be tuned as needed DefaultSearchByDistLimitMultiplier = 10 )
View Source
const ( DefaultShardedLocksCount = 512 DefaultPageSize = 1 )
Variables ¶
This section is empty.
Functions ¶
func AddVectorsToIndex ¶ added in v1.29.0
func AddVectorsToIndex(ctx context.Context, vectors []VectorRecord, vectorIndex VectorIndex) error
func CalculateOptimalSegments ¶ added in v1.25.23
func MultiVectorsEqual ¶ added in v1.29.0
func VectorsEqual ¶ added in v1.24.0
Types ¶
type IndexStats ¶ added in v1.24.23
type IndexStats interface {
IndexType() IndexType
}
type MultiVectorForID ¶
type MultipleVectorForID ¶ added in v1.29.0
type PqMaxPool ¶
type PqMaxPool struct {
// contains filtered or unexported fields
}
func NewPqMaxPool ¶
type QueryVectorDistancer ¶ added in v1.26.0
func (*QueryVectorDistancer) Close ¶ added in v1.26.0
func (q *QueryVectorDistancer) Close()
func (*QueryVectorDistancer) DistanceToNode ¶ added in v1.26.0
func (q *QueryVectorDistancer) DistanceToNode(nodeID uint64) (float32, error)
type SearchByDistParams ¶
type SearchByDistParams struct {
// contains filtered or unexported fields
}
func NewSearchByDistParams ¶
func NewSearchByDistParams( offset int, limit int, totalLimit int, maximumSearchLimit int64, ) *SearchByDistParams
func (*SearchByDistParams) Iterate ¶
func (params *SearchByDistParams) Iterate()
func (*SearchByDistParams) MaxLimitReached ¶
func (params *SearchByDistParams) MaxLimitReached() bool
func (*SearchByDistParams) MaximumSearchLimit ¶
func (params *SearchByDistParams) MaximumSearchLimit() int64
func (*SearchByDistParams) OffsetCapacity ¶
func (params *SearchByDistParams) OffsetCapacity(ids []uint64) int
func (*SearchByDistParams) TotalLimit ¶
func (params *SearchByDistParams) TotalLimit() int
func (*SearchByDistParams) TotalLimitCapacity ¶
func (params *SearchByDistParams) TotalLimitCapacity(ids []uint64) int
type ShardedLocks ¶
type ShardedLocks struct { PageSize uint64 // contains filtered or unexported fields }
func NewDefaultShardedLocks ¶
func NewDefaultShardedLocks() *ShardedLocks
func NewShardedLocks ¶
func NewShardedLocks(count uint64) *ShardedLocks
func NewShardedLocksWithPageSize ¶ added in v1.28.0
func NewShardedLocksWithPageSize(pageSize uint64) *ShardedLocks
func (*ShardedLocks) Lock ¶
func (sl *ShardedLocks) Lock(id uint64)
func (*ShardedLocks) LockAll ¶
func (sl *ShardedLocks) LockAll()
func (*ShardedLocks) Locked ¶
func (sl *ShardedLocks) Locked(id uint64, callback func())
func (*ShardedLocks) LockedAll ¶
func (sl *ShardedLocks) LockedAll(callback func())
func (*ShardedLocks) Unlock ¶
func (sl *ShardedLocks) Unlock(id uint64)
func (*ShardedLocks) UnlockAll ¶
func (sl *ShardedLocks) UnlockAll()
type ShardedRWLocks ¶ added in v1.24.0
type ShardedRWLocks struct { PageSize uint64 // contains filtered or unexported fields }
func NewDefaultShardedRWLocks ¶ added in v1.24.0
func NewDefaultShardedRWLocks() *ShardedRWLocks
func NewShardedRWLocks ¶ added in v1.24.0
func NewShardedRWLocks(count uint64) *ShardedRWLocks
func NewShardedRWLocksWithPageSize ¶ added in v1.28.0
func NewShardedRWLocksWithPageSize(pageSize uint64) *ShardedRWLocks
func (*ShardedRWLocks) Lock ¶ added in v1.24.0
func (sl *ShardedRWLocks) Lock(id uint64)
func (*ShardedRWLocks) LockAll ¶ added in v1.24.0
func (sl *ShardedRWLocks) LockAll()
func (*ShardedRWLocks) Locked ¶ added in v1.24.0
func (sl *ShardedRWLocks) Locked(id uint64, callback func())
func (*ShardedRWLocks) LockedAll ¶ added in v1.24.0
func (sl *ShardedRWLocks) LockedAll(callback func())
func (*ShardedRWLocks) RLock ¶ added in v1.24.0
func (sl *ShardedRWLocks) RLock(id uint64)
func (*ShardedRWLocks) RLockAll ¶ added in v1.24.0
func (sl *ShardedRWLocks) RLockAll()
func (*ShardedRWLocks) RLocked ¶ added in v1.24.0
func (sl *ShardedRWLocks) RLocked(id uint64, callback func())
func (*ShardedRWLocks) RLockedAll ¶ added in v1.24.0
func (sl *ShardedRWLocks) RLockedAll(callback func())
func (*ShardedRWLocks) RUnlock ¶ added in v1.24.0
func (sl *ShardedRWLocks) RUnlock(id uint64)
func (*ShardedRWLocks) RUnlockAll ¶ added in v1.24.0
func (sl *ShardedRWLocks) RUnlockAll()
func (*ShardedRWLocks) Unlock ¶ added in v1.24.0
func (sl *ShardedRWLocks) Unlock(id uint64)
func (*ShardedRWLocks) UnlockAll ¶ added in v1.24.0
func (sl *ShardedRWLocks) UnlockAll()
type SharedGauge ¶ added in v1.24.22
type SharedGauge struct {
// contains filtered or unexported fields
}
SharedGauge is a thread-safe gauge that can be shared between multiple goroutines. It is used to track the number of running tasks, and allows to wait until all tasks are done.
func NewSharedGauge ¶ added in v1.24.22
func NewSharedGauge() *SharedGauge
func (*SharedGauge) Count ¶ added in v1.24.22
func (sc *SharedGauge) Count() int64
func (*SharedGauge) Decr ¶ added in v1.24.22
func (sc *SharedGauge) Decr()
func (*SharedGauge) Incr ¶ added in v1.24.22
func (sc *SharedGauge) Incr()
func (*SharedGauge) Wait ¶ added in v1.24.22
func (sc *SharedGauge) Wait()
type SparseFisherYatesIterator ¶ added in v1.27.0
type SparseFisherYatesIterator struct {
// contains filtered or unexported fields
}
SparseFisherYatesIterator implements the Iterator interface using the Sparse Fisher-Yates algorithm.
func NewSparseFisherYatesIterator ¶ added in v1.27.0
func NewSparseFisherYatesIterator(size int) *SparseFisherYatesIterator
NewSparseFisherYatesIterator creates a new SparseFisherYatesIterator with the given size.
func (*SparseFisherYatesIterator) IsDone ¶ added in v1.27.0
func (s *SparseFisherYatesIterator) IsDone() bool
IsDone checks if all elements have been sampled.
func (*SparseFisherYatesIterator) Next ¶ added in v1.27.0
func (s *SparseFisherYatesIterator) Next() *int
Next returns the next sampled index using the Sparse Fisher-Yates algorithm.
type TargetTempVectorForID ¶ added in v1.24.11
type TargetTempVectorForID[T []float32 | float32] struct { TargetVector string TempVectorForIDThunk func(ctx context.Context, id uint64, container *VectorSlice, targetVector string) ([]T, error) }
func (TargetTempVectorForID[T]) TempVectorForID ¶ added in v1.24.11
func (t TargetTempVectorForID[T]) TempVectorForID(ctx context.Context, id uint64, container *VectorSlice) ([]T, error)
type TargetVectorForID ¶ added in v1.24.11
type TargetVectorForID[T []float32 | float32 | byte | uint64] struct { TargetVector string VectorForIDThunk func(ctx context.Context, id uint64, targetVector string) ([]T, error) }
func (TargetVectorForID[T]) VectorForID ¶ added in v1.24.11
func (t TargetVectorForID[T]) VectorForID(ctx context.Context, id uint64) ([]T, error)
type TempVectorForID ¶
type TempVectorUint64Pool ¶ added in v1.27.0
type TempVectorUint64Pool struct {
// contains filtered or unexported fields
}
func NewTempUint64VectorsPool ¶ added in v1.27.0
func NewTempUint64VectorsPool() *TempVectorUint64Pool
func (*TempVectorUint64Pool) Get ¶ added in v1.27.0
func (pool *TempVectorUint64Pool) Get(capacity int) *VectorUint64Slice
func (*TempVectorUint64Pool) Put ¶ added in v1.27.0
func (pool *TempVectorUint64Pool) Put(container *VectorUint64Slice)
type TempVectorsPool ¶
type TempVectorsPool struct {
// contains filtered or unexported fields
}
func NewTempVectorsPool ¶
func NewTempVectorsPool() *TempVectorsPool
func (*TempVectorsPool) Get ¶
func (pool *TempVectorsPool) Get(capacity int) *VectorSlice
func (*TempVectorsPool) Put ¶
func (pool *TempVectorsPool) Put(container *VectorSlice)
type Vector ¶ added in v1.29.0
func (*Vector[T]) Validate ¶ added in v1.29.0
func (v *Vector[T]) Validate(vectorIndex VectorIndex) error
type VectorForID ¶
type VectorIndex ¶ added in v1.29.0
type VectorRecord ¶ added in v1.28.0
type VectorRecord interface { Len() int Validate(vectorIndex VectorIndex) error }
type VectorSlice ¶
type VectorUint64Slice ¶ added in v1.27.0
type VectorUint64Slice struct {
Slice []uint64
}
Click to show internal directories.
Click to hide internal directories.