What problem does it solve?
This Skill addresses slow, imprecise, or unscalable text search in PostgreSQL/Supabase databases by defining indexed search vectors, safe query parsing, and relevance ranking so applications return relevant matches quickly.
Core Features & Use Cases
- Indexing & Performance: Create tsvector columns or generated columns and GIN indexes to enable fast, scalable text search across large datasets.
- Relevance & Ranking: Weight fields (title, content, tags), use ts_rank or ts_rank_cd, and apply thresholds to surface the most relevant results.
- Robust Querying: Safely parse user input with plainto_tsquery or websearch_to_tsquery, support multi-language configurations, fuzzy matching via pg_trgm, autocomplete, and highlight snippets for UI presentation.
- Operational Patterns: Use triggers or generated columns for auto-updates, partial indexes for filtered sets, EXPLAIN ANALYZE for tuning, and Supabase RPCs/migrations for integration.
Quick Start
Create a tsvector search column from title and content, add a GIN index, populate it with to_tsvector or a trigger/generated column, and run a websearch_to_tsquery query to retrieve ranked results.