Development · GitHub repo

hn-search

Full-text search over 49M Hacker News items using Neon Postgres BM25

Visit github.com ↗

hn-search is an open-source Next.js application that provides real-time full-text search across ~49 million Hacker News stories, comments, jobs, and polls. Instead of relying on external search platforms like Elasticsearch or Algolia, it runs native BM25 ranking directly inside Neon Lakebase Postgres using SQL-over-HTTP. It serves as a practical architectural reference for high-performance, in-database text search on large Postgres datasets.

What it's for

  • Search the full Hacker News archive including stories, comments, and polls
  • Study how to implement native BM25 full-text ranking directly inside PostgreSQL
  • Learn database optimization patterns like partial indexes and SQL-over-HTTP with serverless Postgres

Features

  • In-database BM25 ranking using Neon Lakebase Postgres
  • Type-specific partial BM25 and GIN indexes to prevent ranking candidate exhaustion
  • Stateless SQL-over-HTTP database querying via Neon serverless driver
  • Streaming UI built with Next.js App Router and React Server Components
  • Typo tolerance and auto-correction using pg_trgm and fuzzystrmatch
  • Background sync cron job pulling new Hacker News items regularly

Pricing

Open source

Details

Type
GitHub repo
Category
Development
Topic
Search Architecture
Open source
Yes
Platforms
Web, Self-hosted
For
Postgres developers, backend engineers, and Next.js developers exploring in-database search architectures.
Alternative to
Algolia HN Search
Tags
postgres, bm25, nextjs, full text search, neon, hackernews, sql

Why it was saved

  • @rishi_raj_jain_, 14 September 2026: Lets you read or copy the implementation of a fast search stack: Neon Postgres, in-database BM25 via Lakebase Search, SQL-over-HTTP, pg_prewarm, partial indexes, Vercel deployment.

Related

  • hnfaster

    Fast full-text search across 49M Hacker News items using Postgres BM25

  • Supabase Stripe Wrapper

    PostgreSQL foreign data wrapper to query and write Stripe data via SQL

  • Natural Language Postgres

    Query a Postgres database with natural language and visualize results.

  • Natural Language Postgres Guide

    Build a Next.js app to query PostgreSQL using natural language

  • shadcn/ui

    Copy-paste React UI components built with Tailwind CSS and Radix primitives.

  • Efferd

    Pre-built, responsive shadcn/ui blocks and layouts for React applications

Updated