pgvector

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Name = "pgvector"

Functions

func New

func New(config any) (vdb.VDB, error)

Types

type Config

type Config struct {
	DNS      string
	Table    string
	Schema   string
	Columns  []string
	Embedder embedding.Embedder
	Distance vdb.Distance
	Index    *IndexConfig
}

type IndexConfig

type IndexConfig struct {
	Name   string
	Type   string
	Params map[string]any // 支持更多索引参数
}

type VectorDB

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

func (*VectorDB) Close

func (v *VectorDB) Close() error

func (*VectorDB) Create

func (v *VectorDB) Create(ctx context.Context) error

func (*VectorDB) Delete

func (v *VectorDB) Delete(ctx context.Context, id string) error

func (*VectorDB) Search

func (v *VectorDB) Search(ctx context.Context, embedding []float32, opts ...vdb.SearchOption) ([]*vdb.Document, error)

vector similarity search

func (*VectorDB) SearchQuery

func (v *VectorDB) SearchQuery(ctx context.Context, query string, opts ...vdb.SearchOption) ([]*vdb.Document, error)

func (*VectorDB) SearchQueryWithOptions

func (v *VectorDB) SearchQueryWithOptions(ctx context.Context, query string, options *vdb.SearchOptions) ([]*vdb.Document, error)

func (*VectorDB) SearchWithOptions

func (v *VectorDB) SearchWithOptions(ctx context.Context, embedding []float32, options *vdb.SearchOptions) ([]*vdb.Document, error)

func (*VectorDB) Store

func (v *VectorDB) Store(ctx context.Context, docs ...*vdb.Document) error

Jump to

Keyboard shortcuts

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