Blog search with one Postgres trigger: tsvector, Anorm and snippets that never trust HTML
How this blog's search works end to end: a weighted tsvector side table kept by a trigger, a thin Anorm query with websearch_to_tsquery and ts_rank, and highlighted snippets split on control characters instead of rendered HTML.