I keep reaching for a search service and then remembering Postgres already has one.
A tsvector column, a GIN index, and a trigger to keep it current gets you:
- stemmed matches (search "deploying" finds "deploy")
- ranking with
ts_rank - phrase queries with
phraseto_tsquery - zero extra infrastructure
The gotchas are worth knowing: configuration matters for language, weight classes let you boost titles, and you'll want a custom dictionary if your domain has product names that shouldn't be stemmed.
Where it stops being enough: fuzzy matching on typos, per-field highlighting at scale, and multi-language relevance that changes with the query. That's when you move.
Until then, the search box is 30 lines of SQL and a migration.
What's the smallest thing that made you switch to a real search engine?
Top comments (0)