Documentation
¶
Overview ¶
Package usearch provides implementation of Go API for https://github.com/unum-cloud/usearch
Index ¶
- type Option
- func WithConnectivity(connectivity int) Option
- func WithDimension(dim int) Option
- func WithExpansionAdd(expansionAdd int) Option
- func WithExpansionSearch(expansionSearch int) Option
- func WithIndexPath(path string) Option
- func WithMetricType(metricType string) Option
- func WithMulti(multi bool) Option
- func WithQuantizationType(quantizationType string) Option
- type Usearch
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*usearch) error
Option represents the functional option for usearch.
func WithConnectivity ¶
WithConnectivity represents the option to set the connectivity for usearch.
func WithDimension ¶
WithDimension represents the option to set the dimension for usearch.
func WithExpansionAdd ¶
WithExpansionAdd represents the option to set the expansion add for usearch.
func WithExpansionSearch ¶
WithExpansionSearch represents the option to set the expansion search for usearch.
func WithIndexPath ¶
WithIndexPath represents the option to set the index path for usearch.
func WithMetricType ¶
WithMetricType represents the option to set the metricType for usearch.
func WithQuantizationType ¶
WithQuantizationType represents the option to set the quantizationType for usearch.
type Usearch ¶
type Usearch interface {
// SaveIndex saves the USearch index to storage.
SaveIndex() error
// SaveIndexWithPath saves the USearch index to the specified path.
SaveIndexWithPath(path string) error
// GetIndicesSize returns the number of vectors in index.
GetIndicesSize() (indicesSize int, err error)
// Reserve reserves memory for vectors of given number of arg.
Reserve(vectorCount int) error
// Add adds vectors to the USearch index and returns the total count.
Add(key uint64, vec []float32) error
// Search performs a nearest neighbor search and returns the results.
Search(q []float32, k int) ([]algorithm.SearchResult, error)
// GetObject retruns search result by id as []algorithm.SearchResult.
GetObject(key core.Key, count int) ([]float32, error)
// Remove removes vectors from the index by key.
Remove(key uint64) error
// Close frees the resources used by the USearch index.
Close() error
}
Uuearch is the core interface for interacting with usearch index.