Google Cloud Adds Native BM25 Full-Text Search to AlloyDB and Cloud SQL via pg_textsearch
Google Cloud announced the integration of the open-source pg_textsearch extension into both AlloyDB and Cloud SQL for PostgreSQL, bringing native BM25 full-text search and relevance scoring directly into managed PostgreSQL environments. The extension, developed in C on PostgreSQL's core storage layer in collaboration with Tiger Data, allows database engines to calculate BM25 relevance scores natively without routing queries or replicating data to external search backends.
For database administrators and platform engineers building retrieval-augmented generation (RAG) and document retrieval systems, this release removes a major architectural headache: the dedicated search sidecar. Historically, standard PostgreSQL full-text search relied on tsvector/tsquery, which lacks native BM25 term weighting and document length normalization, forcing teams to replicate operational data into Elasticsearch or OpenSearch. Managing synchronization pipelines via Change Data Capture (CDC) or event buses routinely introduces latency, eventual consistency gaps, and extra infrastructure costs. Bringing robust BM25 ranking directly into the primary database allows developers to execute accurate lexical search alongside vector search in a single SQL query.
This update fits a prominent consolidation trend across the cloud database ecosystem: the convergence of multimodal retrieval inside relational and transactional engines. Rather than managing distinct vector, lexical, and transactional engines, public cloud providers are increasingly baking advanced indexing algorithms directly into managed PostgreSQL. Google Cloud previously added ScaNN (Scalable Nearest Neighbors) vector indexing to AlloyDB; combining ScaNN-accelerated vector retrieval with native BM25 creates an end-to-end hybrid search engine that operates entirely within PostgreSQL ACID boundaries.
In practice, engineering teams should evaluate their search architectures for consolidation opportunities. For workloads with moderate search scale, standard catalog querying, or RAG context retrieval, querying pg_textsearch combined with pgvector inside AlloyDB or Cloud SQL can eliminate external indexing services and their associated CDC pipelines. However, practitioners must evaluate database CPU and memory allocation, as heavy BM25 index builds and complex reciprocal rank fusion (RRF) queries share compute resources with core transactional workloads. Teams should benchmark index build times and ensure appropriate read-replica sizing before migrating high-volume search traffic into their primary database tier.
Read original source