---
title: "Comparing Native Postgres, ElasticSearch, and pg_search for Full-Text Search"
description: "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."
url: "https://swe.quest/articles/comparing-native-postgres-elasticsearch-and-pg-search-for-full-text-search-b83c564af59c02c3"
canonical: "https://neon.com/blog/postgres-full-text-search-vs-elasticsearch"
source: "Neon"
published: "2025-06-13"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 9
tags: ["search","postgres","performance"]
---

# Comparing Native Postgres, ElasticSearch, and pg\_search for Full-Text Search

A post on [Neon](https://swe.quest/sources/neon.md), published 2025-06-13, 9 min read, Deep dive. Original: [https://neon.com/blog/postgres-full-text-search-vs-elasticsearch](https://neon.com/blog/postgres-full-text-search-vs-elasticsearch)

## Summary

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.

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)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- PostgreSQL indexes ([easy posts on PostgreSQL](https://swe.quest/tags/postgres.md?difficulty=easy))
- SQL queries ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- full-text search basics ([easy posts on Search](https://swe.quest/tags/search.md?difficulty=easy))

## Keywords

pg\_search, ParadeDB, ElasticSearch, Tantivy, BM25, GIN index, tsvector, Neon

## Related posts

- [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.
- [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.
- [TIN v1.0.6: 2-3x faster, with support for stemming](https://swe.quest/articles/tin-v1-0-6-2-3x-faster-with-support-for-stemming-ea2ddc443b54feaf.md): PlanetScale · 2026-10-08 · Medium · 8 min read · Search, PostgreSQL, Performance engineering
  TIN v1.0.6, PlanetScale's Postgres full-text search index, adds Snowball-based stemming for 18 languages via the rust\_stemmers crate and extends its block-max top-k plan to queries with heap-attribute tiebreakers in ORDER BY.
- [Build Your Own Full-Text Search CMS with Neon and pg\_search](https://swe.quest/articles/build-your-own-full-text-search-cms-with-neon-and-pg-search-d1362b037df7a369.md): Neon · 2025-07-07 · Medium · 12 min read · Search, PostgreSQL, TypeScript
  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 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.

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)
