pg_search
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.20.4 | FTS | AGPL-3.0 | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
--s-dt- | No | Yes | No | Yes | no | yes |
| Relationships | |
|---|---|
| See Also | pgroonga pgroonga_database pg_bestmatch vchord_bm25 pg_bigm zhparser pg_tokenizer pg_trgm |
PG 17+ does not require dynamic loading
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.20.4 | 18 17 16 15 14 13 | pg_search | - |
| RPM | PIGSTY | 0.20.4 | 18 17 16 15 14 13 | pg_search_$v | - |
| DEB | PIGSTY | 0.20.3 | 18 17 16 15 14 13 | postgresql-$v-pg-search | - |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 | PG13 |
|---|---|---|---|---|---|---|
el8.x86_64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
el8.aarch64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
el9.x86_64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
el9.aarch64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
el10.x86_64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
el10.aarch64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
d12.x86_64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
d12.aarch64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
d13.x86_64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
d13.aarch64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
u22.x86_64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
u22.aarch64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
u24.x86_64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
u24.aarch64 | MISS | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | PIGSTY 0.20.4 | MISS |
Source
pig build pkg pg_search; # build rpm / deb with pigInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall this extension with pig:
pig install pg_search; # install via package name, for the active PG version
pig install pg_search -v 17; # install for PG 17
pig install pg_search -v 16; # install for PG 16
pig install pg_search -v 15; # install for PG 15
pig install pg_search -v 14; # install for PG 14Create this extension with:
CREATE EXTENSION pg_search;THIS EXTENSION is built by ParadeDB team and delivered by the PIGSTY repo
Usage
https://docs.paradedb.com/documentation/getting-started/quickstart
CREATE EXTENSION pg_search;
ALTER SYSTEM SET paradedb.pg_search_telemetry TO 'off';
CALL paradedb.create_bm25_test_table(
schema_name => 'public',
table_name => 'mock_items'
);
SELECT description, rating, category FROM mock_items LIMIT 3;
CALL paradedb.create_bm25(
index_name => 'search_idx',
schema_name => 'public',
table_name => 'mock_items',
key_field => 'id',
text_fields => paradedb.field('description', tokenizer => paradedb.tokenizer('en_stem')) ||
paradedb.field('category'),
numeric_fields => paradedb.field('rating')
);
SELECT description, rating, category
FROM search_idx.search('(description:keyboard OR category:electronics) AND rating:>2',limit_rows => 5);
CALL paradedb.create_bm25(
index_name => 'ngrams_idx',
schema_name => 'public',
table_name => 'mock_items',
key_field => 'id',
text_fields => paradedb.field('description', tokenizer => paradedb.tokenizer('ngram', min_gram => 4, max_gram => 4, prefix_only => false)) ||
paradedb.field('category')
);
SELECT description, rating, category
FROM ngrams_idx.search('description:blue');Last updated on