---
title: "Build Your Own Full-Text Search CMS with Neon and pg_search"
description: "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."
url: "https://swe.quest/articles/build-your-own-full-text-search-cms-with-neon-and-pg-search-d1362b037df7a369"
canonical: "https://neon.com/blog/full-text-search-cms-pgsearch"
source: "Neon"
published: "2025-07-07"
difficulty: "medium"
kind: "How-to"
reading_minutes: 12
tags: ["search","postgres","typescript"]
---

# Build Your Own Full-Text Search CMS with Neon and pg\_search

A post on [Neon](https://swe.quest/sources/neon.md), published 2025-07-07, 12 min read, How-to. Original: [https://neon.com/blog/full-text-search-cms-pgsearch](https://neon.com/blog/full-text-search-cms-pgsearch)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- PostgreSQL basics ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- Next.js ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- TypeScript ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))

## Keywords

pg\_search, ParadeDB, Neon, BM25, Prisma, Next.js, Zod

## Related posts

- [Search From a Million Books in Milliseconds With Neon and pg\_search](https://swe.quest/articles/search-from-a-million-books-in-milliseconds-with-neon-and-pg-search-2b2bd7a3bf8b0ad8.md): Neon · 2025-03-26 · Medium · 6 min read · PostgreSQL, Search, Performance engineering
  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.
- [pg\_search is Available on Neon](https://swe.quest/articles/pg-search-is-available-on-neon-98d919ff82afb749.md): Neon · 2025-03-18 · Medium · 8 min read · PostgreSQL, Search, Performance engineering
  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.
- [Comparing Native Postgres, ElasticSearch, and pg\_search for Full-Text Search](https://swe.quest/articles/comparing-native-postgres-elasticsearch-and-pg-search-for-full-text-search-b83c564af59c02c3.md): Neon · 2025-06-13 · Medium · 9 min read · Search, PostgreSQL, Performance engineering
  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.
- [Semantic search using OpenAI, pg\_embedding and Neon](https://swe.quest/articles/semantic-search-using-openai-pg-embedding-and-neon-aeafbc27d93ca728.md): Neon · 2023-08-25 · Medium · 9 min read · Vector search, PostgreSQL, LLMs, Serverless, TypeScript
  A YC idea-matcher app implements semantic search by embedding ~4,400 YCombinator company descriptions with OpenAI's text-embedding-ada-002 (1536 dimensions) and storing them as real\[\] columns in Neon Postgres via the pg\_embedding extension.
- [Postgres Full Text Search vs the rest](https://swe.quest/articles/postgres-full-text-search-vs-the-rest-f34d597d7fad8021.md): Supabase · 2022-10-14 · Medium · 11 min read · PostgreSQL, Search, Performance engineering, SQLite
  Postgres built-in full text search, using a generated tsvector column with a GIN index and websearch\_to\_tsquery, performs close to dedicated engines like Typesense, MeiliSearch, OpenSearch and SQLite FTS5 in default configurations on a small movie dataset.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
