Tacnode
Explainer3 min

Postgres Full-Text Search, Explained

Most engineers reach for LIKE when they need text search. It works on small data, then breaks — slow at scale, no stemming, no typo tolerance, no relevance ranking. Postgres has a real full-text search engine built in: tsvector, tsquery, GIN inverted indexes, weighted fields, all behind standard SQL. Tacnode ships BM25 ranking natively on top — the same algorithm Elasticsearch uses, no extra service to deploy.

Overview

An entry-level walkthrough of Postgres full-text search: where LIKE breaks (linear scan + no stemming + no typos + no ranking), the three pieces that make FTS work (tokenize / inverted index / match), and how Tacnode's native BM25 ranking lands on top of standard Postgres syntax.

Topics Covered

  • Why LIKE queries break at scale and don't really do search
  • Postgres tokenization, stemming, and stop-word handling
  • GIN inverted indexes — word → rows that contain it
  • Setup: tsvector columns with weighted fields + GIN index
  • Native BM25 ranking in Tacnode via the <@> operator and plainto_bm25query

Key Takeaways

  • Postgres has a production-grade full-text search engine — no Elasticsearch needed for most workloads
  • Setup is one tsvector column + one GIN index
  • Tacnode adds BM25 ranking natively — the same algorithm Elasticsearch uses, in your Postgres
  • FTS, vector search, and structured filters all share one engine — hybrid retrieval in a single SQL query

Ready to get started?

Book a demo to see how Tacnode can power your real-time data infrastructure.