pg_search
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_search | 0.24.0 | FTS | AGPL-3.0 | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2100 | pg_search | No | Yes | Yes | Yes | No | No | paradedb |
| Related | pgroonga pgroonga_database pg_bestmatch vchord_bm25 pg_bigm zhparser pg_tokenizer pg_trgm |
|---|
bm25 am conflicts with pg_textsearch and vchord_bm25
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.24.0 | 1817161514 | pg_search | - |
| RPM | PIGSTY | 0.24.0 | 1817161514 | pg_search_$v | - |
| DEB | PIGSTY | 0.24.0 | 1817161514 | postgresql-$v-pg-search | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.24.0 el8.x86_64.pg18 : pg_search_18 pg_search_18-0.24.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY 0.24.0 el8.x86_64.pg17 : pg_search_17 pg_search_17-0.24.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY 0.24.0 el8.x86_64.pg16 : pg_search_16 pg_search_16-0.24.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY 0.24.0 el8.x86_64.pg15 : pg_search_15 pg_search_15-0.24.0-1PIGSTY.el8.x86_64.rpm
| PIGSTY MISS |
| el8.aarch64 | PIGSTY 0.24.0 el8.aarch64.pg18 : pg_search_18 pg_search_18-0.24.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY 0.24.0 el8.aarch64.pg17 : pg_search_17 pg_search_17-0.24.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY 0.24.0 el8.aarch64.pg16 : pg_search_16 pg_search_16-0.24.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY 0.24.0 el8.aarch64.pg15 : pg_search_15 pg_search_15-0.24.0-1PIGSTY.el8.aarch64.rpm
| PIGSTY MISS |
| el9.x86_64 | PIGSTY 0.24.0 el9.x86_64.pg18 : pg_search_18 pg_search_18-0.24.0-1PARADEDB.el9.x86_64.rpm
| PIGSTY 0.24.0 el9.x86_64.pg17 : pg_search_17 pg_search_17-0.24.0-1PARADEDB.el9.x86_64.rpm
| PIGSTY 0.24.0 el9.x86_64.pg16 : pg_search_16 pg_search_16-0.24.0-1PARADEDB.el9.x86_64.rpm
| PIGSTY 0.24.0 el9.x86_64.pg15 : pg_search_15 pg_search_15-0.24.0-1PARADEDB.el9.x86_64.rpm
| PIGSTY MISS |
| el9.aarch64 | PIGSTY 0.24.0 el9.aarch64.pg18 : pg_search_18 pg_search_18-0.24.0-1PARADEDB.el9.aarch64.rpm
| PIGSTY 0.24.0 el9.aarch64.pg17 : pg_search_17 pg_search_17-0.24.0-1PARADEDB.el9.aarch64.rpm
| PIGSTY 0.24.0 el9.aarch64.pg16 : pg_search_16 pg_search_16-0.24.0-1PARADEDB.el9.aarch64.rpm
| PIGSTY 0.24.0 el9.aarch64.pg15 : pg_search_15 pg_search_15-0.24.0-1PARADEDB.el9.aarch64.rpm
| PIGSTY MISS |
| el10.x86_64 | PIGSTY 0.24.0 el10.x86_64.pg18 : pg_search_18 pg_search_18-0.24.0-1PARADEDB.el10.x86_64.rpm
| PIGSTY 0.24.0 el10.x86_64.pg17 : pg_search_17 pg_search_17-0.24.0-1PARADEDB.el10.x86_64.rpm
| PIGSTY 0.24.0 el10.x86_64.pg16 : pg_search_16 pg_search_16-0.24.0-1PARADEDB.el10.x86_64.rpm
| PIGSTY 0.24.0 el10.x86_64.pg15 : pg_search_15 pg_search_15-0.24.0-1PARADEDB.el10.x86_64.rpm
| PIGSTY MISS |
| el10.aarch64 | PIGSTY 0.24.0 el10.aarch64.pg18 : pg_search_18 pg_search_18-0.24.0-1PARADEDB.el10.aarch64.rpm
| PIGSTY 0.24.0 el10.aarch64.pg17 : pg_search_17 pg_search_17-0.24.0-1PARADEDB.el10.aarch64.rpm
| PIGSTY 0.24.0 el10.aarch64.pg16 : pg_search_16 pg_search_16-0.24.0-1PARADEDB.el10.aarch64.rpm
| PIGSTY 0.24.0 el10.aarch64.pg15 : pg_search_15 pg_search_15-0.24.0-1PARADEDB.el10.aarch64.rpm
| PIGSTY MISS |
| d12.x86_64 | PIGSTY 0.24.0 d12.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0_amd64.deb
| PIGSTY 0.24.0 d12.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0_amd64.deb
| PIGSTY 0.24.0 d12.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0_amd64.deb
| PIGSTY 0.24.0 d12.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0_amd64.deb
| PIGSTY 0.20.7 d12.x86_64.pg14 : postgresql-14-pg-search postgresql-14-pg-search_0.20.7_amd64.deb
|
| d12.aarch64 | PIGSTY 0.24.0 d12.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0_arm64.deb
| PIGSTY 0.24.0 d12.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0_arm64.deb
| PIGSTY 0.24.0 d12.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0_arm64.deb
| PIGSTY 0.24.0 d12.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0_arm64.deb
| PIGSTY 0.20.7 d12.aarch64.pg14 : postgresql-14-pg-search postgresql-14-pg-search_0.20.7_arm64.deb
|
| d13.x86_64 | PIGSTY 0.24.0 d13.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0_amd64.deb
| PIGSTY 0.24.0 d13.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0_amd64.deb
| PIGSTY 0.24.0 d13.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0_amd64.deb
| PIGSTY 0.24.0 d13.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0_amd64.deb
| PIGSTY 0.20.5 d13.x86_64.pg14 : postgresql-14-pg-search postgresql-14-pg-search_0.20.5-1PIGSTY~trixie_amd64.deb
|
| d13.aarch64 | PIGSTY 0.24.0 d13.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0_arm64.deb
| PIGSTY 0.24.0 d13.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0_arm64.deb
| PIGSTY 0.24.0 d13.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0_arm64.deb
| PIGSTY 0.24.0 d13.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0_arm64.deb
| PIGSTY 0.20.5 d13.aarch64.pg14 : postgresql-14-pg-search postgresql-14-pg-search_0.20.5-1PIGSTY~trixie_arm64.deb
|
| u22.x86_64 | PIGSTY 0.24.0 u22.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 0.24.0 u22.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 0.24.0 u22.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 0.24.0 u22.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0-1PIGSTY~jammy_amd64.deb
| PIGSTY 0.20.7 u22.x86_64.pg14 : postgresql-14-pg-search postgresql-14-pg-search_0.20.7_amd64.deb
|
| u22.aarch64 | PIGSTY 0.24.0 u22.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 0.24.0 u22.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 0.24.0 u22.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 0.24.0 u22.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0-1PIGSTY~jammy_arm64.deb
| PIGSTY 0.20.7 u22.aarch64.pg14 : postgresql-14-pg-search postgresql-14-pg-search_0.20.7_arm64.deb
|
| u24.x86_64 | PIGSTY 0.24.0 u24.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0_amd64.deb
| PIGSTY 0.24.0 u24.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0_amd64.deb
| PIGSTY 0.24.0 u24.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0_amd64.deb
| PIGSTY 0.24.0 u24.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0_amd64.deb
| PIGSTY 0.20.7 u24.x86_64.pg14 : postgresql-14-pg-search postgresql-14-pg-search_0.20.7_amd64.deb
|
| u24.aarch64 | PIGSTY 0.24.0 u24.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0_arm64.deb
| PIGSTY 0.24.0 u24.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0_arm64.deb
| PIGSTY 0.24.0 u24.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0_arm64.deb
| PIGSTY 0.24.0 u24.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0_arm64.deb
| PIGSTY 0.20.7 u24.aarch64.pg14 : postgresql-14-pg-search postgresql-14-pg-search_0.20.7_arm64.deb
|
| u26.x86_64 | PIGSTY 0.24.0 u26.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0-2PIGSTY~resolute_amd64.deb
| PIGSTY 0.24.0 u26.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0-2PIGSTY~resolute_amd64.deb
| PIGSTY 0.24.0 u26.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0-2PIGSTY~resolute_amd64.deb
| PIGSTY 0.24.0 u26.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0-2PIGSTY~resolute_amd64.deb
| PIGSTY MISS |
| u26.aarch64 | PIGSTY 0.24.0 u26.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.24.0-2PIGSTY~resolute_arm64.deb
| PIGSTY 0.24.0 u26.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.24.0-2PIGSTY~resolute_arm64.deb
| PIGSTY 0.24.0 u26.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.24.0-2PIGSTY~resolute_arm64.deb
| PIGSTY 0.24.0 u26.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.24.0-2PIGSTY~resolute_arm64.deb
| PIGSTY MISS |
Build
You can build the RPM / DEB packages for pg_search using pig build:
pig build pkg pg_search # build RPM / DEB packages
Install
You can install pg_search directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pg_search; # Install for current active PG version
pig ext install -y pg_search -v 18 # PG 18
pig ext install -y pg_search -v 17 # PG 17
pig ext install -y pg_search -v 16 # PG 16
pig ext install -y pg_search -v 15 # PG 15
dnf install -y pg_search_18 # PG 18
dnf install -y pg_search_17 # PG 17
dnf install -y pg_search_16 # PG 16
dnf install -y pg_search_15 # PG 15
apt install -y postgresql-18-pg-search # PG 18
apt install -y postgresql-17-pg-search # PG 17
apt install -y postgresql-16-pg-search # PG 16
apt install -y postgresql-15-pg-search # PG 15
Preload:
shared_preload_libraries = 'pg_search';
Create Extension:
CREATE EXTENSION pg_search;
Usage
Sources: ParadeDB extension install docs, create-index docs, match docs, score docs, highlight docs, v0.24.0 release, pg_search README
pg_search is ParadeDB’s BM25-based search extension for PostgreSQL. The upstream README says support starts at PostgreSQL 15; Pigsty packages 0.24.0 for PostgreSQL 15-18 and builds it with cargo-pgrx 0.18.1.
Enable And Create The Extension
shared_preload_libraries = 'pg_search'
CREATE EXTENSION pg_search;
The self-hosted extension docs require shared_preload_libraries = 'pg_search' before CREATE EXTENSION.
Create A BM25 Index
Current examples use the bm25 access method with a unique key field:
CREATE INDEX search_idx ON mock_items
USING bm25 (id, description, category, rating)
WITH (key_field = 'id');
Only one BM25 index is supported per table. key_field is mandatory, must be unique, and must be the first indexed column; text key fields must be untokenized.
Query Operators And Helpers
The current docs use these query operators:
|||: match disjunction, equivalent toterm1 OR term2.&&&: match conjunction, equivalent toterm1 AND term2.
Examples:
SELECT description, rating
FROM mock_items
WHERE description ||| 'running shoes'
ORDER BY rating
LIMIT 5;
SELECT description, pdb.score(id) AS score
FROM mock_items
WHERE description &&& 'running shoes'
ORDER BY score DESC
LIMIT 5;
SELECT description, pdb.snippet(description) AS snippet, pdb.score(id) AS score
FROM mock_items
WHERE description ||| 'running shoes'
ORDER BY score DESC
LIMIT 5;
Useful result helpers include pdb.score(id), pdb.snippet(field), pdb.snippets(field), and pdb.snippet_positions(field). Highlighting is relatively expensive and is not supported for fuzzy search queries.
Notes
- The old quickstart URL was removed; use the versioned docs pages above for current
|||,&&&, scoring, and highlighting syntax. - Release
0.24.0requires preloadingpg_search, upgrades pgrx to 0.18.1, and documents crash-recovery,ltree, and inline-tokenizer work without changing the basic BM25 query examples above. - The Pigsty metadata notes that the
bm25access method conflicts withpg_textsearchandvchord_bm25; do not preload competing BM25 access-method extensions in the same cluster without testing the target combination.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.