hnsw

package
v0.13.0-prerelease-test-4 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HnswVectorIndexType = "HnswVectorIndex"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HnswVectorIndex

type HnswVectorIndex struct {
	HnswIndex *hnsw.Graph[string]
	// contains filtered or unexported fields
}

func NewHnswVectorIndex

func NewHnswVectorIndex(searchMethod, embedder string) *HnswVectorIndex

func (*HnswVectorIndex) DeleteVector

func (ims *HnswVectorIndex) DeleteVector(ctx context.Context, textId int64, key string) error

func (*HnswVectorIndex) GetCheckpointId

func (ims *HnswVectorIndex) GetCheckpointId(ctx context.Context) (int64, error)

func (*HnswVectorIndex) GetEmbedderName

func (ims *HnswVectorIndex) GetEmbedderName() string

func (*HnswVectorIndex) GetLastIndexedTextId

func (ims *HnswVectorIndex) GetLastIndexedTextId(ctx context.Context) (int64, error)

func (*HnswVectorIndex) GetSearchMethodName

func (ims *HnswVectorIndex) GetSearchMethodName() string

func (*HnswVectorIndex) GetVector

func (ims *HnswVectorIndex) GetVector(ctx context.Context, key string) ([]float32, error)

func (*HnswVectorIndex) GetVectorNodesMap

func (ims *HnswVectorIndex) GetVectorNodesMap() map[string][]float32

func (*HnswVectorIndex) InsertVector

func (ims *HnswVectorIndex) InsertVector(ctx context.Context, textId int64, vec []float32) error

func (*HnswVectorIndex) InsertVectorToMemory

func (ims *HnswVectorIndex) InsertVectorToMemory(ctx context.Context, textId, vectorId int64, key string, vec []float32) error

func (*HnswVectorIndex) InsertVectors

func (ims *HnswVectorIndex) InsertVectors(ctx context.Context, textIds []int64, vecs [][]float32) error

func (*HnswVectorIndex) InsertVectorsToMemory

func (ims *HnswVectorIndex) InsertVectorsToMemory(ctx context.Context, textIds []int64, vectorIds []int64, keys []string, vecs [][]float32) error

func (*HnswVectorIndex) Search

func (ims *HnswVectorIndex) Search(ctx context.Context, query []float32, maxResults int, filter index.SearchFilter) (utils.MaxTupleHeap, error)

func (*HnswVectorIndex) SearchWithKey

func (ims *HnswVectorIndex) SearchWithKey(ctx context.Context, queryKey string, maxResults int, filter index.SearchFilter) (utils.MaxTupleHeap, error)

func (*HnswVectorIndex) SetEmbedderName

func (ims *HnswVectorIndex) SetEmbedderName(embedderName string) error

Jump to

Keyboard shortcuts

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