Engineering

pgx-bm25 1.0 ranks search results inside PostgreSQL

PGX released pgx-bm25 1.0, a PostgreSQL index that does BM25 ranking without a separate search service.

Choi Hyun-im

PGX Inc. released pgx-bm25 1.0 on 7 October 2026. It adds Okapi BM25 ranked full-text search as a native PostgreSQL index access method, installed as bm25_native. Supported servers are PostgreSQL 17 and 18. PostgreSQL 19 is exercised against the current beta and is not a supported major version yet.

The design choice is to stay inside the database. The index lives in the index relation’s own pages, so write-ahead logging, crash recovery, and physical replication come from PostgreSQL itself. VACUUM maintains it. There is no external search cluster and no second process to keep alive. The extension is C, built with PGXS against stock server headers. A C compiler and pg_config are the toolchain.

It is under the PostgreSQL License, the same terms as the server. PGX describes it as a standalone project: no dependency on another product, no separate commercial edition. Source, regression tests, TAP tests, benchmark scripts, and a written design record are in the repository at github.com/pgexperts/pgx-bm25. CI covers PostgreSQL 17 and 18, including assert builds, UBSan, AddressSanitizer, crash recovery, and replica equality.

The on-disk format is part of the contract. Additive changes are not supposed to require REINDEX. Where a breaking change can be migrated, bm25_upgrade() does it in place. That is the difference between an index you can experiment with and an index you can leave in a restored backup.

Teams that already run PostgreSQL and have been exporting text to a search engine can now ask a narrower question. If BM25 ranking on 17 or 18 is the actual requirement, the index might replace that export. If they need features the extension does not implement, the separate engine stays. The 1.0 release is the point where that comparison is possible on a crash-safe index rather than a prototype.