Documentation
¶
Overview ¶
Package postgres provides a PostgreSQL pgvector-backed Reliquary index.
Index ¶
- type Config
- type Index
- func (i *Index) DeleteDocument(ctx context.Context, documentID string) error
- func (i *Index) Migrate(ctx context.Context) error
- func (i *Index) ReplaceDocuments(ctx context.Context, replacements []indexcontract.DocumentReplacement) error
- func (i *Index) Reset(ctx context.Context) error
- func (i *Index) Search(ctx context.Context, query indexcontract.IndexQuery) ([]*retrieval.Result, error)
- func (i *Index) Upsert(ctx context.Context, items []*retrieval.Result) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Table string
}
Config controls PostgreSQL index storage. Migrate must be called explicitly before the index is used.
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index stores retrieval candidates in a caller-owned PostgreSQL pool.
func (*Index) DeleteDocument ¶
DeleteDocument transactionally removes all results for a document.
func (*Index) Migrate ¶
Migrate idempotently creates retrieval-owned PostgreSQL schema. It is never called implicitly by New or data operations.
func (*Index) ReplaceDocuments ¶ added in v0.9.0
func (i *Index) ReplaceDocuments(ctx context.Context, replacements []indexcontract.DocumentReplacement) error
ReplaceDocuments atomically replaces complete document revisions. The table lock serializes retained-corpus dimension and identity discovery with all other writers.
func (*Index) Search ¶
func (i *Index) Search(ctx context.Context, query indexcontract.IndexQuery) ([]*retrieval.Result, error)
Search retrieves candidates in PostgreSQL and performs final Reliquary scoring over only that bounded candidate set.