vss

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

sqlite-vss related operations

Index

Constants

View Source
const (
	TableNamePrefix  = "vss_"
	KeyDimension     = "vss_dimension"
	ExtensionVector0 = "vector0"
	ExtensionVss0    = "vss0"
)

Variables

This section is empty.

Functions

func RegisterHooks

func RegisterHooks(app core.App, vssDao *VssDao)

Types

type VssDao

type VssDao struct {
	daos.Dao
}

func NewDao

func NewDao(app core.App) (*VssDao, error)

func (*VssDao) ResetDB

func (dao *VssDao) ResetDB() error

ResetDB takes care for releasing initialized app resources (eg. closing db connections).

type VssQuery

type VssQuery struct {
	Dao    *daos.Dao
	VssDao *VssDao
}

func (VssQuery) Delete

func (q VssQuery) Delete(record *models.Record) error

func (VssQuery) Insert

func (q VssQuery) Insert(record *models.Record) error

func (VssQuery) Search

func (q VssQuery) Search(requestInfo *models.RequestInfo, collection *models.Collection, field string, criteria string, limit int64) (*VssResult, error)

func (VssQuery) Update

func (q VssQuery) Update(record *models.Record) error

type VssResult

type VssResult struct {
	TotalItems int             `json:"totalItems"`
	Items      []VssResultItem `json:"items"`
}

type VssResultItem

type VssResultItem struct {
	Distance float64        `json:"distance"`
	Record   *models.Record `json:"item"`
}

Jump to

Keyboard shortcuts

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