Versions in this module Expand all Collapse all v0 v0.4.6 Jun 16, 2022 Changes in this version + type Bruteforce struct + func NewBruteforce(vectors []Vector) *Bruteforce + func (b *Bruteforce) Build() + func (b *Bruteforce) MultiSearch(q Vector, terms []string, n int, prune0 bool) (values map[string][]int32, scores map[string][]float32) + func (b *Bruteforce) Search(q Vector, n int, prune0 bool) (values []int32, scores []float32) + type CentroidVector interface + Distance func(vector Vector) float32 + type DenseVector struct + func NewDenseVector(data []float32, terms []string, isHidden bool) *DenseVector + func (v *DenseVector) Centroid(_ []Vector, _ []int32) CentroidVector + func (v *DenseVector) Distance(vector Vector) float32 + func (v *DenseVector) IsHidden() bool + func (v *DenseVector) Terms() []string + type DictionaryCentroidVector struct + func (v *DictionaryCentroidVector) Distance(vector Vector) float32 + type DictionaryVector struct + func NewDictionaryVector(indices []int32, values []float32, terms []string, isHidden bool) *DictionaryVector + func (v *DictionaryVector) Distance(vector Vector) float32 + func (v *DictionaryVector) Dot(vector *DictionaryVector) (float32, float32) + func (v *DictionaryVector) IsHidden() bool + func (v *DictionaryVector) Terms() []string + func (v DictionaryVector) Centroid(vectors []Vector, indices []int32) CentroidVector + type HNSW struct + func NewHNSW(vectors []Vector, configs ...HNSWConfig) *HNSW + func (h *HNSW) Build() + func (h *HNSW) MultiSearch(q Vector, terms []string, n int, prune0 bool) (values map[string][]int32, scores map[string][]float32) + func (h *HNSW) Search(q Vector, n int, prune0 bool) (values []int32, scores []float32) + type HNSWBuilder struct + func NewHNSWBuilder(data []Vector, k, testSize, numJobs int) *HNSWBuilder + func (b *HNSWBuilder) Build(recall float32, trials int, prune0 bool) (idx *HNSW, score float32) + type HNSWConfig func(*HNSW) + func SetEFConstruction(efConstruction int) HNSWConfig + func SetHNSWNumJobs(numJobs int) HNSWConfig + func SetMaxConnection(maxConnection int) HNSWConfig + type IVF struct + func NewIVF(vectors []Vector, configs ...IVFConfig) *IVF + func (idx *IVF) Build() + func (idx *IVF) MultiSearch(q Vector, terms []string, n int, prune0 bool) (values map[string][]int32, scores map[string][]float32) + func (idx *IVF) Search(q Vector, n int, prune0 bool) (values []int32, scores []float32) + type IVFBuilder struct + func NewIVFBuilder(data []Vector, k, testSize int, configs ...IVFConfig) *IVFBuilder + func (b *IVFBuilder) Build(recall float32, numEpoch int, prune0 bool) (idx *IVF, score float32) + type IVFConfig func(ivf *IVF) + func SetClusterErrorRate(errorRate float32) IVFConfig + func SetIVFNumJobs(numJobs int) IVFConfig + func SetNumProbe(numProbe int) IVFConfig + type Vector interface + Centroid func(vectors []Vector, indices []int32) CentroidVector + Distance func(vector Vector) float32 + IsHidden func() bool + Terms func() []string + type VectorIndex interface + Build func() + MultiSearch func(q Vector, terms []string, n int, prune0 bool) (map[string][]int32, map[string][]float32) + Search func(q Vector, n int, prune0 bool) ([]int32, []float32)