index

package
v0.0.2-0...-6735cf7 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HnswSearchSimple hnswSearchAlgorithm = iota
	HnswSearchHeuristic
)
View Source
const HNSW_VERTEX_EDGE_BYTES = 8 + 4
View Source
const HNSW_VERTEX_MUTEX_BYTES = 24
View Source
const VERTICES_MAP_SHARD_COUNT int = 16

Variables

View Source
var (
	ItemNotFoundError      error = errors.New("Item not found")
	ItemAlreadyExistsError error = errors.New("Item already exists")
)
View Source
var (
	InvalidSpaceTypeErr error = errors.New("Invalid space type")
	NoEntrypointErr     error = errors.New("No entrypoint")
)

Functions

This section is empty.

Types

type Hnsw

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

func NewHnsw

func NewHnsw(size uint, space space.Space, options ...HnswOption) *Hnsw

func (*Hnsw) BytesSize

func (this *Hnsw) BytesSize() uint64

func (*Hnsw) Get

func (this *Hnsw) Get(id uuid.UUID) (math.Vector, error)

func (*Hnsw) GetVertex

func (this *Hnsw) GetVertex(id uuid.UUID) (*hnswVertex, error)

func (*Hnsw) Insert

func (this *Hnsw) Insert(id uuid.UUID, value math.Vector, metadata Metadata, vertexLevel int) error

func (*Hnsw) Len

func (this *Hnsw) Len() int

func (*Hnsw) Load

func (this *Hnsw) Load(r io.Reader, header bool) error

func (*Hnsw) RandomLevel

func (this *Hnsw) RandomLevel() int

func (*Hnsw) Remove

func (this *Hnsw) Remove(id uuid.UUID) error

func (*Hnsw) Save

func (this *Hnsw) Save(w io.Writer, header bool) error

func (*Hnsw) Search

func (this *Hnsw) Search(ctx context.Context, query math.Vector, k uint) (SearchResult, error)

func (*Hnsw) String

func (this *Hnsw) String() string

type HnswOption

type HnswOption interface {
	// contains filtered or unexported methods
}

Options

func HnswEf

func HnswEf(value int) HnswOption

func HnswEfConstruction

func HnswEfConstruction(value int) HnswOption

func HnswHeuristicExtendCandidates

func HnswHeuristicExtendCandidates(value bool) HnswOption

func HnswHeuristicKeepPruned

func HnswHeuristicKeepPruned(value bool) HnswOption

func HnswLevelMultiplier

func HnswLevelMultiplier(value float32) HnswOption

func HnswM

func HnswM(value int) HnswOption

func HnswMmax

func HnswMmax(value int) HnswOption

func HnswMmax0

func HnswMmax0(value int) HnswOption

func HnswSearchAlgorithm

func HnswSearchAlgorithm(value hnswSearchAlgorithm) HnswOption

type Metadata

type Metadata map[string]string

type SearchResult

type SearchResult []SearchResultItem

func (SearchResult) Len

func (this SearchResult) Len() int

func (SearchResult) Less

func (this SearchResult) Less(i, j int) bool

func (SearchResult) Swap

func (this SearchResult) Swap(i, j int)

type SearchResultItem

type SearchResultItem struct {
	Id       uuid.UUID
	Metadata Metadata
	Score    float32
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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