search

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package search exposes the search.Backend interface and a default adapter that delegates to the active dal.Dialect's FullTextSearch — no external search process is required for the MVP.

See TAD §9.1 and PRD §13.3 for the full specification. Implemented in Phase 2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Index records the given field values for a document in the search index.
	// The default Dialect-based backend is a no-op here (FTS is query-time).
	Index(ctx context.Context, docType, id string, fields map[string]any) error
	// Remove removes a document from the search index.
	// No-op for the Dialect-based backend.
	Remove(ctx context.Context, docType, id string) error
	// Search executes a full-text search and returns matching document IDs.
	Search(ctx context.Context, docType, query string, limit int) ([]string, error)
}

Backend is the search interface. The MVP default delegates to the active Dialect's FullTextSearch (no external search process required). See TAD §9.1 and PRD §13.3.

func NewDialectBackend

func NewDialectBackend(d dal.Dialect, db *sql.DB, tableNames, searchFields map[string][]string) Backend

NewDialectBackend creates a Backend that delegates FTS to the active Dialect. tableNames and searchFields are populated from CompiledDocs at startup.

func NewDialectBackendSimple

func NewDialectBackendSimple(d dal.Dialect, db *sql.DB, tableNames map[string]string, searchFields map[string][]string) Backend

NewDialectBackendSimple creates a Backend from simple docType→tableName and docType→searchFields maps.

Jump to

Keyboard shortcuts

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