Documentation
¶
Index ¶
- type IndexManager
- func (im *IndexManager) CreateIndex(name string, config hnswgo.Config) (*hnswgo.HNSW, error)
- func (im *IndexManager) DeleteIndex(name string) error
- func (im *IndexManager) GetIndex(name string) (*hnswgo.HNSW, bool)
- func (im *IndexManager) IndicesNames() []string
- func (im *IndexManager) LoadIndices() error
- func (im *IndexManager) PersistIndex(name string) error
- func (im *IndexManager) Size() int
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.