Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 8 min read Announcement mediumAdept

pg_search is Available on Neon

ParadeDB's pg_search extension, now available on Neon in AWS regions, adds a Tantivy-powered BM25 inverted index to Postgres, bringing relevance ranking, fuzzy matching, faceting, highlighting and JSON-aware search that native tsvector/GIN full-text search lacks. The BM25 index is a covering index across multiple columns, so filters and aggregations are pushed into a single index scan, and it is MVCC-integrated so new data is searchable on commit without ETL. On a 10-million-row log dataset, it built faster than a GIN index (1.63 vs 2.60 min) but was larger (647 vs 176 MB). It beat a GIN/B-tree-tuned Postgres on every query tested, with the largest gains on ranked top-N, count and filtered queries, e.g. 81 ms vs 38.8 s for BM25-ranked top-10.

Related posts

  • Comparing Native Postgres, ElasticSearch, and pg_search for Full-Text Search

    Neon mediumAdept

    Native Postgres full-text search (tsvector/tsquery with GIN indexes) breaks down at scale because ranking by ts_rank must score every matching row and lacks BM25, fuzzy matching and per-field relevance. ElasticSearch fixes search quality and speed but adds a second source of truth, a sync pipeline, eventual consistency and heavy cluster operations. pg_search, a Rust extension built on Tantivy, embeds a BM25 inverted index inside Postgres with transactional updates, fuzzy and phrase queries, snippets and aggregations. On a 10-million-row benchmark it beat native FTS by 20-1000x (e.g. top-N ranked results in 81ms vs 38.8s), and it is pitched for datasets that fit on a single Postgres instance.

  • Search From a Million Books in Milliseconds With Neon and pg_search

    Neon mediumAdept

    Swapping the OpenAI-embedding semantic search in Vercel's Next.js Book Inventory template for pg_search's BM25 full-text index on Neon Postgres made title searches over a million Goodreads books roughly 180–236x faster, dropping from about 2.7 seconds to 11–14 ms. The setup loads the dataset into a books table, prewarms the table and index with pg_prewarm, creates a covering bm25 index, and queries with the @@@ operator and paradedb.match in conjunction_mode. On the app side, Drizzle is replaced by Neon's HTTP serverless driver, and Vercel functions are co-located in us-east-2 with the database. Side-by-side tsvector/tsquery and pg_search queries with timings are included for reproduction.

  • Build Your Own Full-Text Search CMS with Neon and pg_search

    Neon mediumAdept

    A minimal CMS built on Postgres with Next.js, Prisma and Zod, using the pg_search extension's BM25 index for full-text search instead of a hosted CMS. Search runs as a three-stage cascade: BM25 keyword search with title/body score boosts (2x title, 2.5x both), then phrase search with slop for multi-word queries, then fuzzy Levenshtein matching whose edit distance scales with query length (1–3). Raw SQL goes through Neon's serverless driver because Prisma can't express pg_search operators, and paradedb.snippet supplies highlighted excerpts. Neon has since deprecated pg_search for new projects.

  • Anatomy of a (Postgres) search engine

    PlanetScale mediumAdept

    Inverted indexes power full-text search by mapping each term to a sorted, compressed postings list of document IDs, with optional positional data for phrase/span queries and frequency statistics for BM25 scoring. Postings can be delta-encoded or stored as bitmaps for fast SIMD intersection, and block-level statistics let top-k queries skip whole blocks. Indexes are built as immutable segments plus a mutable segment, with deletes handled by tombstones and periodic merges that trade heavy I/O against per-query overhead. Inside Postgres, such an index must map to ctids, be WAL-logged, reuse freed pages, run merges in background workers, and cooperate with VACUUM.

  • On-disk HNSW index for Postgres with pg_embedding

    Neon mediumAdept

    pg_embedding's new version builds its HNSW vector index on disk rather than in memory and adds cosine, Manhattan and Euclidean (L2) distance support. Benchmarks on an 8 vCPU / 32 GB machine show the in-memory index is roughly 2x faster, but persisting the index lets it work with Neon's autoscaling, scale-to-zero and read replicas for read-heavy similarity search. The post walks through enabling the extension, storing embeddings as real[] and tuning the index parameters dims, m, efConstruction and efSearch, where efSearch should be at least the query's LIMIT k. Neon has since discontinued pg_embedding and recommends pgvector instead.

The quest for software engineering knowledge.

Look:
Layout: