pg_rrf
Overview
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 1845 | pg_rrf | No | Yes | No | Yes | No | No | - |
| Related | pg_search pg_bestmatch vector pgcontext vectorize pg_textsearch vchord_bm25 pg_fts pgmnemo pg_similarity |
|---|
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.0.3 | 1817161514 | pg_rrf | - |
| RPM | PIGSTY | 0.0.3 | 1817161514 | pg_rrf_$v | - |
| DEB | PIGSTY | 0.0.3 | 1817161514 | postgresql-$v-pg-rrf | - |
Build
You can build the RPM / DEB packages for pg_rrf using pig build:
Install
You can install pg_rrf directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources: README, v0.0.3 release
pg_rrf provides Reciprocal Rank Fusion functions for hybrid search score fusion.
It is focused on combining ranked candidate lists without hand-written FULL OUTER JOIN / COALESCE plumbing.
Core Functions
rrf(rank_a, rank_b, k)rrf3(rank_a, rank_b, rank_c, k)rrf_fuse(ids_a bigint[], ids_b bigint[], k int default 60)rrfn(ranks bigint[], k int)
The v0.0.3 release explicitly adds rrfn while keeping rrf and rrf3 as compatibility wrappers. The README documents the same score behavior:
- missing ranks are ignored
- ranks
<= 0are ignored k <= 0raises an error
Example
Hybrid Search Pattern
The upstream README shows rrf_fuse as a replacement for a manual fusion query:
Notes
The README targets PostgreSQL 14-17 and documents Docker-based build and test flows. The extension surface remains intentionally small: score helpers plus rrf_fuse for the common two-list hybrid-search pattern.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)