pg-smart-search
API Reference

TrigramSearchEngine API

Complete API reference for the TrigramSearchEngine class, including constructors, methods, and configuration.

TrigramSearchEngine API

The main entry point for the search SDK.

Constructor

new TrigramSearchEngine(adapter: DatabaseAdapter, config: EngineConfig)

EngineConfig

Prop

Type


Methods

engine.search()

Executes a hybrid parallel search.

engine.search(params: SearchOptions): Promise<SearchResult>

SearchParams

Prop

Type

engine.health()

Checks the health of the engine and its dependencies.

engine.health(): Promise<HealthStatus>

Returns the status of the database and the configured cache provider (there is no vector-provider check -- see Types).

engine.verifyIndexes(sampleQuery?)

Runs EXPLAIN against each active tier's representative query and flags any sequential scan it finds -- a cheap way to catch a missing/misconfigured index in CI or at startup.

engine.verifyIndexes(sampleQuery?: string): Promise<{ ok: boolean; warnings: string[] }>

engine.metrics

A MetricsCollector instance, not a plain data object. Call .getSummary() to get a point-in-time snapshot.

engine.metrics.getSummary(): EngineMetrics