Back to articles
Next.js job board search: Postgres FTS + trgm

Next.js job board search: Postgres FTS + trgm

via Dev.to WebdevSathish

My job board has 8,000+ listings. Basic ILIKE died fast. I combined Postgres full-text search with pg_trgm for typos. I rank results with a single SQL function. No app-side scoring. I ship it via Supabase RPC + a simple Next.js route. Context I’m building a job board for Psychiatric Mental Health Nurse Practitioners. Search is the whole product. If search feels dumb, users bounce. I started with ILIKE '%term%' . It worked for 200 listings. Then I crossed ~8,000 active listings and it got brutal. Slow queries. Weird ranking. Typos returning nothing. I didn’t want Elasticsearch. Not for this. I already have Postgres (Supabase). So I leaned into it. Goal: fast search, decent ranking, typo tolerance. And something I can maintain solo. 1) I stopped doing ILIKE . It’s a trap. ILIKE is fine for admin screens. Not for user-facing search. Two problems hit me. First: performance. ILIKE '%remote%' can’t use a normal btree index. It scans. Second: ranking. Everything matches the same. A job with “

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
3 views

Related Articles