⬤ PostgreSQL just got a serious search upgrade with pg_textsearch, a new open-source extension that brings proper relevance ranking right into the database. Here's the thing: search has always been Postgres' Achilles heel, forcing teams to bolt on external systems like Elasticsearch or pay for managed search services. The extension, released by TigerDatabase, changes that by enabling modern keyword search natively within Postgres.
⬤ The problem wasn't that Postgres couldn't do text search—it was that its ranking sucked. The built-in ts_rank function uses a basic term frequency algorithm that just doesn't cut it compared to what modern search engines deliver. That's why teams have been stuck running separate search clusters, building sync pipelines that constantly drift, or shelling out per-query fees for managed platforms. pg_textsearch fixes this by implementing BM25, the exact same ranking algorithm powering Elasticsearch, Lucene, and pretty much every serious search engine out there.
⬤ With pg_textsearch, BM25 ranking runs straight inside Postgres using simple SQL syntax. You can drop relevance-ranked search into existing queries with barely any changes. The extension supports configurable parameters and works with Postgres text search configurations, including multilingual setups. It's also built to work seamlessly with pgvector, letting you combine keyword relevance with vector-based semantic similarity—all in one database.
⬤ This matters because it cuts out external search infrastructure while actually improving search quality inside Postgres. By bringing keyword and semantic search together, pg_textsearch simplifies your architecture and reduces operational headaches. For the database world, getting BM25 inside Postgres signals a bigger shift: keeping more core functionality in a single, open-source database instead of juggling multiple specialized systems.
Eseandre Mordi
Eseandre Mordi