pg_search
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_search | 0.25.1 | 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 | vector pg_textsearch pg_bestmatch vchord_bm25 pg_fts pgroonga pg_rrf psql_bm25s pgcontext vectorize pgfaceting roaringbitmap rum |
|---|
Requires shared_preload_libraries=pg_search and pgvector; bm25 access method conflicts with pg_textsearch and vchord_bm25; PIGSTY uses pgrx 0.19.1 for upstream pgrx 0.19.0.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.25.1 | 1817161514 | pg_search | vector |
| RPM | PIGSTY | 0.25.1 | 1817161514 | pg_search_$v | pgvector_$v, openblas |
| DEB | PIGSTY | 0.25.1 | 1817161514 | postgresql-$v-pg-search | postgresql-$v-pgvector, libopenblas0 |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.25.1 el8.x86_64.pg18 : pg_search_18 pg_search_18-0.25.1-1PIGSTY.el8.x86_64.rpm
| PIGSTY 0.25.1 el8.x86_64.pg17 : pg_search_17 pg_search_17-0.25.1-1PIGSTY.el8.x86_64.rpm
| PIGSTY 0.25.1 el8.x86_64.pg16 : pg_search_16 pg_search_16-0.25.1-1PIGSTY.el8.x86_64.rpm
| PIGSTY 0.25.1 el8.x86_64.pg15 : pg_search_15 pg_search_15-0.25.1-1PIGSTY.el8.x86_64.rpm
| N/A |
| el8.aarch64 | PIGSTY 0.25.1 el8.aarch64.pg18 : pg_search_18 pg_search_18-0.25.1-1PIGSTY.el8.aarch64.rpm
| PIGSTY 0.25.1 el8.aarch64.pg17 : pg_search_17 pg_search_17-0.25.1-1PIGSTY.el8.aarch64.rpm
| PIGSTY 0.25.1 el8.aarch64.pg16 : pg_search_16 pg_search_16-0.25.1-1PIGSTY.el8.aarch64.rpm
| PIGSTY 0.25.1 el8.aarch64.pg15 : pg_search_15 pg_search_15-0.25.1-1PIGSTY.el8.aarch64.rpm
| N/A |
| el9.x86_64 | PIGSTY 0.25.1 el9.x86_64.pg18 : pg_search_18 pg_search_18-0.25.1-1PIGSTY.el9.x86_64.rpm
| PIGSTY 0.25.1 el9.x86_64.pg17 : pg_search_17 pg_search_17-0.25.1-1PIGSTY.el9.x86_64.rpm
| PIGSTY 0.25.1 el9.x86_64.pg16 : pg_search_16 pg_search_16-0.25.1-1PIGSTY.el9.x86_64.rpm
| PIGSTY 0.25.1 el9.x86_64.pg15 : pg_search_15 pg_search_15-0.25.1-1PIGSTY.el9.x86_64.rpm
| N/A |
| el9.aarch64 | PIGSTY 0.25.1 el9.aarch64.pg18 : pg_search_18 pg_search_18-0.25.1-1PIGSTY.el9.aarch64.rpm
| PIGSTY 0.25.1 el9.aarch64.pg17 : pg_search_17 pg_search_17-0.25.1-1PIGSTY.el9.aarch64.rpm
| PIGSTY 0.25.1 el9.aarch64.pg16 : pg_search_16 pg_search_16-0.25.1-1PIGSTY.el9.aarch64.rpm
| PIGSTY 0.25.1 el9.aarch64.pg15 : pg_search_15 pg_search_15-0.25.1-1PIGSTY.el9.aarch64.rpm
| N/A |
| el10.x86_64 | PIGSTY 0.25.1 el10.x86_64.pg18 : pg_search_18 pg_search_18-0.25.1-1PIGSTY.el10.x86_64.rpm
| PIGSTY 0.25.1 el10.x86_64.pg17 : pg_search_17 pg_search_17-0.25.1-1PIGSTY.el10.x86_64.rpm
| PIGSTY 0.25.1 el10.x86_64.pg16 : pg_search_16 pg_search_16-0.25.1-1PIGSTY.el10.x86_64.rpm
| PIGSTY 0.25.1 el10.x86_64.pg15 : pg_search_15 pg_search_15-0.25.1-1PIGSTY.el10.x86_64.rpm
| N/A |
| el10.aarch64 | PIGSTY 0.25.1 el10.aarch64.pg18 : pg_search_18 pg_search_18-0.25.1-1PIGSTY.el10.aarch64.rpm
| PIGSTY 0.25.1 el10.aarch64.pg17 : pg_search_17 pg_search_17-0.25.1-1PIGSTY.el10.aarch64.rpm
| PIGSTY 0.25.1 el10.aarch64.pg16 : pg_search_16 pg_search_16-0.25.1-1PIGSTY.el10.aarch64.rpm
| PIGSTY 0.25.1 el10.aarch64.pg15 : pg_search_15 pg_search_15-0.25.1-1PIGSTY.el10.aarch64.rpm
| N/A |
| d12.x86_64 | PIGSTY 0.25.1 d12.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~bookworm_amd64.deb
| PIGSTY 0.25.1 d12.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~bookworm_amd64.deb
| PIGSTY 0.25.1 d12.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~bookworm_amd64.deb
| PIGSTY 0.25.1 d12.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-1PIGSTY~bookworm_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.25.1 d12.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~bookworm_arm64.deb
| PIGSTY 0.25.1 d12.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~bookworm_arm64.deb
| PIGSTY 0.25.1 d12.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~bookworm_arm64.deb
| PIGSTY 0.25.1 d12.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-1PIGSTY~bookworm_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.25.1 d13.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~trixie_amd64.deb
| PIGSTY 0.25.1 d13.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~trixie_amd64.deb
| PIGSTY 0.25.1 d13.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~trixie_amd64.deb
| PIGSTY 0.25.1 d13.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-1PIGSTY~trixie_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.25.1 d13.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~trixie_arm64.deb
| PIGSTY 0.25.1 d13.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~trixie_arm64.deb
| PIGSTY 0.25.1 d13.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~trixie_arm64.deb
| PIGSTY 0.25.1 d13.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-1PIGSTY~trixie_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.25.1 u22.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~jammy_amd64.deb
| PIGSTY 0.25.1 u22.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~jammy_amd64.deb
| PIGSTY 0.25.1 u22.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~jammy_amd64.deb
| PIGSTY 0.25.1 u22.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-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.25.1 u22.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~jammy_arm64.deb
| PIGSTY 0.25.1 u22.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~jammy_arm64.deb
| PIGSTY 0.25.1 u22.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~jammy_arm64.deb
| PIGSTY 0.25.1 u22.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-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.25.1 u24.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~noble_amd64.deb
| PIGSTY 0.25.1 u24.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~noble_amd64.deb
| PIGSTY 0.25.1 u24.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~noble_amd64.deb
| PIGSTY 0.25.1 u24.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-1PIGSTY~noble_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.25.1 u24.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~noble_arm64.deb
| PIGSTY 0.25.1 u24.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~noble_arm64.deb
| PIGSTY 0.25.1 u24.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~noble_arm64.deb
| PIGSTY 0.25.1 u24.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-1PIGSTY~noble_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.25.1 u26.x86_64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~resolute_amd64.deb
| PIGSTY 0.25.1 u26.x86_64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~resolute_amd64.deb
| PIGSTY 0.25.1 u26.x86_64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~resolute_amd64.deb
| PIGSTY 0.25.1 u26.x86_64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-1PIGSTY~resolute_amd64.deb
| N/A |
| u26.aarch64 | PIGSTY 0.25.1 u26.aarch64.pg18 : postgresql-18-pg-search postgresql-18-pg-search_0.25.1-1PIGSTY~resolute_arm64.deb
| PIGSTY 0.25.1 u26.aarch64.pg17 : postgresql-17-pg-search postgresql-17-pg-search_0.25.1-1PIGSTY~resolute_arm64.deb
| PIGSTY 0.25.1 u26.aarch64.pg16 : postgresql-16-pg-search postgresql-16-pg-search_0.25.1-1PIGSTY~resolute_arm64.deb
| PIGSTY 0.25.1 u26.aarch64.pg15 : postgresql-15-pg-search postgresql-15-pg-search_0.25.1-1PIGSTY~resolute_arm64.deb
| N/A |
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 CASCADE; -- requires: vector
Usage
Sources:
- pg_search v0.25.1 README
- pg_search v0.25.1 release
- pg_search v0.25.1 changelog
- Create a ParadeDB index
- Full-text match operators
- BM25 scoring
- Highlighting and snippets
- Index vectors
- Query vectors
- Hybrid-search overview
pg_search adds ParadeDB’s full-text, structured, vector, and hybrid search index to PostgreSQL. Version 0.25 uses the paradedb index access method; the older bm25 access-method name remains a compatibility alias. The extension requires vector, supports PostgreSQL 15-18 upstream, and must be loaded through shared_preload_libraries.
Install and Build an Index
shared_preload_libraries = 'pg_search'
Restart PostgreSQL, then create the extension and a table with a stable unique key:
CREATE EXTENSION pg_search CASCADE;
CREATE TABLE documents (
id bigint PRIMARY KEY,
title text,
body text,
category text,
embedding vector(768)
);
CREATE INDEX documents_search_idx ON documents
USING paradedb (
id,
title,
body,
category,
embedding vector_cosine_ops
)
WITH (key_field = 'id');
The key_field must be the first indexed column and uniquely identify every row. A text key must be indexed without tokenization. A table can have only one ParadeDB index, so include every searchable field in that index.
Full-Text Search
Use ||| to match any token and &&& to require all tokens:
SELECT id, title, pdb.score(id) AS score
FROM documents
WHERE body ||| 'postgresql search'
ORDER BY score DESC, id;
SELECT id, pdb.snippet(body) AS excerpt
FROM documents
WHERE body &&& 'postgresql indexing';
pdb.score(key_field) exposes the relevance score for the current row. pdb.snippet(indexed_text_column) returns a highlighted excerpt. These helpers are meaningful only in a query driven by a ParadeDB search predicate.
Vector Search
Vector indexing is beta in the 0.25 line and uses the vector type from pgvector. Choose the operator class when the index is created; changing the metric requires rebuilding the index.
SELECT id, title, embedding <=> $1::vector AS distance
FROM documents
WHERE id @@@ pdb.all()
ORDER BY embedding <=> $1::vector, id
LIMIT 20;
Supported index operator classes are vector_l2_ops, vector_ip_ops, and vector_cosine_ops. The 0.25 vector index does not index halfvec, sparsevec, or bit columns.
Hybrid Search
A single ParadeDB index can combine lexical predicates, structured filters, and vector ordering. For more elaborate fusion, use the documented RRF and weighted hybrid-search functions instead of adding scores from unrelated scales directly.
SELECT id, title, pdb.score(id) AS lexical_score
FROM documents
WHERE body ||| 'postgresql extension'
AND category === 'database'
ORDER BY embedding <=> $1::vector, id
LIMIT 20;
Version 0.25.1 and Caveats
- Version 0.25 renamed the primary index access method from
bm25toparadedb. ExistingUSING bm25definitions remain supported, but new examples should useUSING paradedb. - Version 0.25.1 supports deterministic vector tie breakers and pushes the vector arm of reciprocal-rank-fusion queries into the index. It also adds
paradedb.vector_clustering_threshold, whose default is 500, and caps vector-index build parallelism at four workers. - Version 0.25.1 removes
paradedb.vector_cluster_probe_epsilonand changes the vector-index bounds gate. After upgrading a database from 0.25.0,REINDEXevery ParadeDB index that contains a vector field; installing the new shared library and runningALTER EXTENSIONalone is not sufficient for those indexes. CREATE EXTENSION pg_search CASCADEcan install the requiredvectorextension, but every server process still needs the preload configuration and restart first.- Query plans, tokenization, and ranking can change when an index is rebuilt with different field options. Test relevance and vector recall with production-shaped data before rollout.
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.