pg_search
pg_search : Full text search for PostgreSQL using BM25
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 2100 | pg_search | pg_search | 0.25.2 |
FTS | AGPL-3.0 | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-- | No | Yes | Yes | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | paradedb |
| Requires | vector |
| See Also | pg_textsearch pg_bestmatch vchord_bm25 pg_fts pgroonga pg_rrf psql_bm25s pgcontext vectorize pgfaceting roaringbitmap rum |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.25.2 |
18 17 16 15 14 | pg_search |
vector |
| RPM | PIGSTY | 0.25.2 |
18 17 16 15 14 | pg_search_$v |
pgvector_$v, openblas |
| DEB | PIGSTY | 0.25.2 |
18 17 16 15 14 | postgresql-$v-pg-search |
postgresql-$v-pgvector, libopenblas0 |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| el8.aarch64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| el9.x86_64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| el9.aarch64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| el10.x86_64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| el10.aarch64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| d12.x86_64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| d12.aarch64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| d13.x86_64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| d13.aarch64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| u22.x86_64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| u22.aarch64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| u24.x86_64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| u24.aarch64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| u26.x86_64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
| u26.aarch64 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | PIGSTY 0.25.2 | N/A |
Source
github.com/paradedb/paradedb/tree/main/pg_search
pg_search-0.25.2.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
Sources:
- pg_search v0.25.2 README
- pg_search v0.25.2 release
- pg_search v0.25.2 changelog
- pg_search v0.25.1 migration notes
- Create a ParadeDB index
- Full-text match operators
- BM25 scoring
- Highlighting and snippets
- Index vectors
- Query vectors
- Hybrid-search overview
pg_search 0.25.2 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
Restart PostgreSQL, then create the extension and a table with a stable unique key:
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:
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.
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.
Version 0.25.2 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. - Version 0.25.2 is a stability and correctness release. It fixes fieldless
more_like_thiswith vector columns,pdb.fuzzyunder generic prepared plans, orphaned dynamic filters, several parallel subplan and MPP plan-shape errors, and tightens access controls for typemod definitions. It adds no further index migration beyond the inherited 0.25.0 vector-index rebuild. CREATE EXTENSION pg_search CASCADEcan install the requiredvectorextension, but every server process still needs the preload configuration and restart first. Loading it only withLOADorsession_preload_librariesis insufficient.- 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.