pg_bm25
pg_bm25 · Full text search for PostgreSQL using BM25
Overview
PostgreSQL · 12, 13, 14, 15, 16
| Relationships | |
|---|---|
| Requires | plpgsql |
Usage
Sources:
pg_bm25 is an early ParadeDB/Tantivy full-text-search extension that adds a BM25 index access method and Lucene-style queries to PostgreSQL. This stub describes the cataloged historical fork, whose API is materially different from current ParadeDB extensions; do not substitute current pg_search documentation for this version.
Core Workflow
The control file requires superuser installation and fixes objects in the paradedb schema. Build an index over the table’s composite row and declare the fields to index:
Important Objects
bm25is the index access method backed by Tantivy files.@@@executes a text query against the BM25 index attached to the row’s table.text_fields,numeric_fields,boolean_fields, andjson_fieldsare JSON index options.paradedb.rank_bm25returns the current query’s score for a tuple.paradedb.minmax_bm25normalizes scores for a named index and query.paradedb.schema_bm25reports the Tantivy field schema.paradedb.aggregationruns a Tantivy aggregation request and returns JSON.
Operational Notes
The fork README says PostgreSQL 12 or newer, while its packaged binaries and tests were much narrower. Index data is maintained outside ordinary heap storage by extension code, so test crash recovery, backup/restore, replication, upgrades, VACUUM behavior, and concurrent writes before relying on it. The repository is a historical fork and uses an old 0.3.x API; prefer a maintained search extension for new deployments.