simplevectorindex

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterFn added in v0.0.11

type FilterFn func([]index.SearchResult) []index.SearchResult

type Index

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

func New

func New(name string, outputPath string, embedder index.Embedder) *Index

func (*Index) Add added in v0.0.11

func (s *Index) Add(ctx context.Context, item *index.Data) error

func (*Index) IsEmpty

func (s *Index) IsEmpty() (bool, error)

func (*Index) LoadFromDocuments

func (s *Index) LoadFromDocuments(ctx context.Context, documents []document.Document) error

func (*Index) Query added in v0.0.11

func (s *Index) Query(ctx context.Context, query string, opts ...option.Option) (index.SearchResults, error)

func (*Index) Search added in v0.0.11

func (s *Index) Search(ctx context.Context, values []float64, opts ...option.Option) (index.SearchResults, error)

Jump to

Keyboard shortcuts

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