0Pricing
SQL Academy · Lesson

Full-Text Search with tsvector and GIN

Build production full-text search with tsvector columns, GIN indexes, and configurable text-search dictionaries.

Beyond Substring: Word-Aware Search

Full-text search (FTS) understands words: stemming, stop words, ranking. PostgreSQL has it built in via the tsvector / tsquery types.

Build a tsvector

Parse a document:

SELECT to_tsvector('english', 'The quick brown foxes jumped over');
-- 'brown':3 'fox':4 'jump':5 'quick':2

All lessons in this course

  1. Trigram Search (pg_trgm) for Fuzzy Matching
  2. Full-Text Search with tsvector and GIN
  3. Geospatial Indexing with PostGIS
  4. Vector Search with pgvector
← Back to SQL Academy