pg_fts
pg_fts : Full-text search with BM25 and BM25F ranking
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2230 | pg_fts | pg_fts | 1.9.0 |
FTS | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-dtr | No | Yes | No | Yes | yes | yes |
| Relationships | |
|---|---|
| See Also | pg_search pg_textsearch pg_bestmatch vchord_bm25 pg_rrf pgroonga psql_bm25s pgcontext vectorize |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.9.0 |
18 17 16 15 14 | pg_fts |
- |
| RPM | PIGSTY | 1.9.0 |
18 17 16 15 14 | pg_fts_$v |
- |
| DEB | PIGSTY | 1.9.0 |
18 17 16 15 14 | postgresql-$v-pg-fts |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| el8.aarch64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 1.9.0 | PIGSTY 1.9.0 | N/A | N/A | N/A |
Source
codeberg.org/gregburd/pg_fts
pg_fts-1.9.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
pg_fts 1.9.0 provides full-text search with BM25/BM25F ranking and the dedicated fts inverted index. PostgreSQL 17 and 18 are supported; PostgreSQL 19/master CI is best-effort. The control is trusted and relocatable, and core use needs no shared preload.
Search and Rank
Objects and Queries
ftsdoc and ftsquery represent analyzed documents and queries. to_ftsdoc() and to_ftsquery() construct them; @@@ matches documents and <=> orders relevance distance. The match predicate is required for an indexed KNN ordering scan. Queries support boolean terms, phrases, prefix, fuzzy and regular-expression matching. Multi-column documents support BM25F field weighting. fts_count() and ordinary count queries can use exact index counting; fts_search() exposes direct ranked results. Regex/long-fuzzy acceleration is opt-in through trigrams = on.
Maintenance and Privileges
Pending inserts are immediately searchable; merging is not a visibility prerequisite. fts_merge() compacts segments and fts_vacuum() reclaims physical space. Both write WAL, require index ownership and must run on a primary. Large pending documents can temporarily consume substantial space, so merge and reclaim periodically during bulk ingestion. fts_search() and fts_anomalous_docs() expose indexed content and are revoked from PUBLIC by default; widen access only deliberately. Regular table-query visibility and direct helper access are different permission surfaces.
Upgrade to 1.9.0
After installing matching files, run ALTER EXTENSION pg_fts UPDATE TO '1.9.0'. This release fixes incorrect ranking after deletes and missed top-k results at posting-block boundaries. There is no on-disk format change and no REINDEX requirement. pg_fts.doclen_cache_mb defaults to 64 (0 disables the cache); pg_fts.dense_score_min_df defaults to 32768 (0 disables that scoring path). Account for per-backend cache memory.