pg_search

pg_search

pg_search : Full text search for PostgreSQL using BM25

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
2100
pg_search
pg_search
0.22.2
FTS
AGPL-3.0
Rust
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--s-d--
No
Yes
No
Yes
no
no
Relationships
Schemasparadedb
See Also
pgroonga
pgroonga_database
pg_bestmatch
vchord_bm25
pg_bigm
zhparser
pg_tokenizer
pg_trgm

PG 17+ does not require dynamic loading

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PIGSTY
0.22.2
18
17
16
15
14
pg_search-
RPM
PIGSTY
0.22.2
18
17
16
15
14
pg_search_$v-
DEB
PIGSTY
0.22.2
18
17
16
15
14
postgresql-$v-pg-search-
Linux / PGPG18PG17PG16PG15PG14
el8.x86_64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.10
el8.aarch64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.10
el9.x86_64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.10
el9.aarch64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.10
el10.x86_64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
MISS
el10.aarch64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
MISS
d12.x86_64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.7
d12.aarch64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.7
d13.x86_64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.5
d13.aarch64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.5
u22.x86_64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.7
u22.aarch64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.7
u24.x86_64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.7
u24.aarch64
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.22.2
PIGSTY 0.20.7
PackageVersionOSORGSIZEFile URL
pg_search_180.22.2el8.x86_64pigsty60.8 MiBpg_search_18-0.22.2-1PIGSTY.el8.x86_64.rpm
pg_search_180.22.2el8.aarch64pigsty60.3 MiBpg_search_18-0.22.2-1PIGSTY.el8.aarch64.rpm
pg_search_180.22.2el9.x86_64pigsty60.3 MiBpg_search_18-0.22.2-1PARADEDB.el9.x86_64.rpm
pg_search_180.22.2el9.aarch64pigsty60.9 MiBpg_search_18-0.22.2-1PARADEDB.el9.aarch64.rpm
pg_search_180.22.2el10.x86_64pigsty60.3 MiBpg_search_18-0.22.2-1PARADEDB.el10.x86_64.rpm
pg_search_180.22.2el10.aarch64pigsty60.9 MiBpg_search_18-0.22.2-1PARADEDB.el10.aarch64.rpm
postgresql-18-pg-search0.22.2d12.x86_64pigsty58.9 MiBpostgresql-18-pg-search_0.22.2_amd64.deb
postgresql-18-pg-search0.22.2d12.aarch64pigsty58.3 MiBpostgresql-18-pg-search_0.22.2_arm64.deb
postgresql-18-pg-search0.22.2d13.x86_64pigsty58.9 MiBpostgresql-18-pg-search_0.22.2_amd64.deb
postgresql-18-pg-search0.22.2d13.aarch64pigsty58.3 MiBpostgresql-18-pg-search_0.22.2_arm64.deb
postgresql-18-pg-search0.22.2u22.x86_64pigsty58.9 MiBpostgresql-18-pg-search_0.22.2_amd64.deb
postgresql-18-pg-search0.22.2u22.aarch64pigsty58.3 MiBpostgresql-18-pg-search_0.22.2_arm64.deb
postgresql-18-pg-search0.22.2u24.x86_64pigsty58.9 MiBpostgresql-18-pg-search_0.22.2_amd64.deb
postgresql-18-pg-search0.22.2u24.aarch64pigsty58.3 MiBpostgresql-18-pg-search_0.22.2_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_search_170.22.2el8.x86_64pigsty60.9 MiBpg_search_17-0.22.2-1PIGSTY.el8.x86_64.rpm
pg_search_170.22.2el8.aarch64pigsty60.3 MiBpg_search_17-0.22.2-1PIGSTY.el8.aarch64.rpm
pg_search_170.22.2el9.x86_64pigsty60.3 MiBpg_search_17-0.22.2-1PARADEDB.el9.x86_64.rpm
pg_search_170.22.2el9.aarch64pigsty60.9 MiBpg_search_17-0.22.2-1PARADEDB.el9.aarch64.rpm
pg_search_170.22.2el10.x86_64pigsty60.4 MiBpg_search_17-0.22.2-1PARADEDB.el10.x86_64.rpm
pg_search_170.22.2el10.aarch64pigsty60.9 MiBpg_search_17-0.22.2-1PARADEDB.el10.aarch64.rpm
postgresql-17-pg-search0.22.2d12.x86_64pigsty58.9 MiBpostgresql-17-pg-search_0.22.2_amd64.deb
postgresql-17-pg-search0.22.2d12.aarch64pigsty58.3 MiBpostgresql-17-pg-search_0.22.2_arm64.deb
postgresql-17-pg-search0.22.2d13.x86_64pigsty58.9 MiBpostgresql-17-pg-search_0.22.2_amd64.deb
postgresql-17-pg-search0.22.2d13.aarch64pigsty58.3 MiBpostgresql-17-pg-search_0.22.2_arm64.deb
postgresql-17-pg-search0.22.2u22.x86_64pigsty58.9 MiBpostgresql-17-pg-search_0.22.2_amd64.deb
postgresql-17-pg-search0.22.2u22.aarch64pigsty58.3 MiBpostgresql-17-pg-search_0.22.2_arm64.deb
postgresql-17-pg-search0.22.2u24.x86_64pigsty58.9 MiBpostgresql-17-pg-search_0.22.2_amd64.deb
postgresql-17-pg-search0.22.2u24.aarch64pigsty58.3 MiBpostgresql-17-pg-search_0.22.2_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_search_160.22.2el8.x86_64pigsty60.9 MiBpg_search_16-0.22.2-1PIGSTY.el8.x86_64.rpm
pg_search_160.22.2el8.aarch64pigsty60.3 MiBpg_search_16-0.22.2-1PIGSTY.el8.aarch64.rpm
pg_search_160.22.2el9.x86_64pigsty60.4 MiBpg_search_16-0.22.2-1PARADEDB.el9.x86_64.rpm
pg_search_160.22.2el9.aarch64pigsty60.9 MiBpg_search_16-0.22.2-1PARADEDB.el9.aarch64.rpm
pg_search_160.22.2el10.x86_64pigsty60.4 MiBpg_search_16-0.22.2-1PARADEDB.el10.x86_64.rpm
pg_search_160.22.2el10.aarch64pigsty60.9 MiBpg_search_16-0.22.2-1PARADEDB.el10.aarch64.rpm
postgresql-16-pg-search0.22.2d12.x86_64pigsty58.9 MiBpostgresql-16-pg-search_0.22.2_amd64.deb
postgresql-16-pg-search0.22.2d12.aarch64pigsty58.3 MiBpostgresql-16-pg-search_0.22.2_arm64.deb
postgresql-16-pg-search0.22.2d13.x86_64pigsty58.9 MiBpostgresql-16-pg-search_0.22.2_amd64.deb
postgresql-16-pg-search0.22.2d13.aarch64pigsty58.3 MiBpostgresql-16-pg-search_0.22.2_arm64.deb
postgresql-16-pg-search0.22.2u22.x86_64pigsty58.9 MiBpostgresql-16-pg-search_0.22.2_amd64.deb
postgresql-16-pg-search0.22.2u22.aarch64pigsty58.3 MiBpostgresql-16-pg-search_0.22.2_arm64.deb
postgresql-16-pg-search0.22.2u24.x86_64pigsty58.9 MiBpostgresql-16-pg-search_0.22.2_amd64.deb
postgresql-16-pg-search0.22.2u24.aarch64pigsty58.3 MiBpostgresql-16-pg-search_0.22.2_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_search_150.22.2el8.x86_64pigsty60.8 MiBpg_search_15-0.22.2-1PIGSTY.el8.x86_64.rpm
pg_search_150.22.2el8.aarch64pigsty60.3 MiBpg_search_15-0.22.2-1PIGSTY.el8.aarch64.rpm
pg_search_150.22.2el9.x86_64pigsty60.3 MiBpg_search_15-0.22.2-1PARADEDB.el9.x86_64.rpm
pg_search_150.22.2el9.aarch64pigsty60.9 MiBpg_search_15-0.22.2-1PARADEDB.el9.aarch64.rpm
pg_search_150.22.2el10.x86_64pigsty60.3 MiBpg_search_15-0.22.2-1PARADEDB.el10.x86_64.rpm
pg_search_150.22.2el10.aarch64pigsty60.9 MiBpg_search_15-0.22.2-1PARADEDB.el10.aarch64.rpm
postgresql-15-pg-search0.22.2d12.x86_64pigsty58.9 MiBpostgresql-15-pg-search_0.22.2_amd64.deb
postgresql-15-pg-search0.22.2d12.aarch64pigsty58.3 MiBpostgresql-15-pg-search_0.22.2_arm64.deb
postgresql-15-pg-search0.22.2d13.x86_64pigsty58.9 MiBpostgresql-15-pg-search_0.22.2_amd64.deb
postgresql-15-pg-search0.22.2d13.aarch64pigsty58.3 MiBpostgresql-15-pg-search_0.22.2_arm64.deb
postgresql-15-pg-search0.22.2u22.x86_64pigsty58.9 MiBpostgresql-15-pg-search_0.22.2_amd64.deb
postgresql-15-pg-search0.22.2u22.aarch64pigsty58.3 MiBpostgresql-15-pg-search_0.22.2_arm64.deb
postgresql-15-pg-search0.22.2u24.x86_64pigsty58.9 MiBpostgresql-15-pg-search_0.22.2_amd64.deb
postgresql-15-pg-search0.22.2u24.aarch64pigsty58.3 MiBpostgresql-15-pg-search_0.22.2_arm64.deb
PackageVersionOSORGSIZEFile URL
pg_search_140.20.10el8.x86_64pigsty46.3 MiBpg_search_14-0.20.10-1PARADEDB.el8.x86_64.rpm
pg_search_140.20.10el8.aarch64pigsty45.7 MiBpg_search_14-0.20.10-1PARADEDB.el8.aarch64.rpm
pg_search_140.20.10el9.x86_64pigsty46.1 MiBpg_search_14-0.20.10-1PARADEDB.el9.x86_64.rpm
pg_search_140.20.10el9.aarch64pigsty46.0 MiBpg_search_14-0.20.10-1PARADEDB.el9.aarch64.rpm
postgresql-14-pg-search0.20.7d12.x86_64pigsty45.6 MiBpostgresql-14-pg-search_0.20.7_amd64.deb
postgresql-14-pg-search0.20.7d12.aarch64pigsty45.0 MiBpostgresql-14-pg-search_0.20.7_arm64.deb
postgresql-14-pg-search0.20.5d13.x86_64pigsty45.1 MiBpostgresql-14-pg-search_0.20.5-1PIGSTY~trixie_amd64.deb
postgresql-14-pg-search0.20.5d13.aarch64pigsty44.5 MiBpostgresql-14-pg-search_0.20.5-1PIGSTY~trixie_arm64.deb
postgresql-14-pg-search0.20.7u22.x86_64pigsty45.6 MiBpostgresql-14-pg-search_0.20.7_amd64.deb
postgresql-14-pg-search0.20.7u22.aarch64pigsty45.0 MiBpostgresql-14-pg-search_0.20.7_arm64.deb
postgresql-14-pg-search0.20.7u24.x86_64pigsty45.6 MiBpostgresql-14-pg-search_0.20.7_amd64.deb
postgresql-14-pg-search0.20.7u24.aarch64pigsty45.1 MiBpostgresql-14-pg-search_0.20.7_arm64.deb

Source

pig build pkg pg_search;		# build deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install pg_search;		# install via package name, for the active PG version

pig install pg_search -v 18;   # install for PG 18
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

Create 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;

-- Create a BM25 index (key_field must be UNIQUE, one BM25 index per table)
CREATE INDEX search_idx ON mock_items
USING bm25 (id, description, category, rating, in_stock, created_at, metadata, weight_range)
WITH (key_field='id');

-- Full-text search with @@@ operator
SELECT description, rating, category
FROM mock_items
WHERE description @@@ 'keyboard' AND rating > 2
ORDER BY rating
LIMIT 5;

-- BM25 relevance scoring
SELECT description, paradedb.score(id)
FROM mock_items
WHERE description @@@ 'keyboard'
ORDER BY paradedb.score(id) DESC
LIMIT 5;

-- Highlighting matched terms
SELECT description, paradedb.snippet(description), paradedb.score(id)
FROM mock_items
WHERE description @@@ 'keyboard'
ORDER BY paradedb.score(id) DESC
LIMIT 5;

-- Exact phrase search (use double quotes inside single quotes)
SELECT description, rating, category
FROM mock_items
WHERE description @@@ '"metal keyboard"';

-- Configure text fields with tokenizers (e.g., English stemming)
DROP INDEX search_idx;
CREATE INDEX search_idx ON mock_items
USING bm25 (id, (description::pdb.simple('stemmer=english')), category)
WITH (key_field='id');
Last updated on