indexmanager

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexManager

type IndexManager struct {
	// contains filtered or unexported fields
}

IndexManager allows easy handling of multiple HNSW indices.

func New

func New(path string, logger zerolog.Logger) *IndexManager

New creates a new IndexManager.

func (*IndexManager) CreateIndex

func (im *IndexManager) CreateIndex(name string, config hnswgo.Config) (*hnswgo.HNSW, error)

CreateIndex creates and persists a new index with the given name. If the name is not acceptable or an index with the same name already exists, an error is returned.

func (*IndexManager) DeleteIndex

func (im *IndexManager) DeleteIndex(name string) error

DeleteIndex remove an index, also removing data from disk.

func (*IndexManager) GetIndex

func (im *IndexManager) GetIndex(name string) (*hnswgo.HNSW, bool)

GetIndex returns the HNSW index (if it exists) and reports whether it is found.

func (*IndexManager) IndicesNames

func (im *IndexManager) IndicesNames() []string

IndicesNames returns the names of all indices.

func (*IndexManager) LoadIndices

func (im *IndexManager) LoadIndices() error

LoadIndices load all HNSW indices stored in the configured path.

func (*IndexManager) PersistIndex

func (im *IndexManager) PersistIndex(name string) error

PersistIndex saves the current index to disk.

func (*IndexManager) Size

func (im *IndexManager) Size() int

Size returns the amount of currently loaded indices.

Jump to

Keyboard shortcuts

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