Supabase pgvector Hybrid Search: Vector + FTS Guide
Build supabase pgvector hybrid search: fuse Postgres full-text search with vector similarity using RRF, HNSW indexes, and a Flutter RPC call.
Your search box is lying to your users. Type "wireless headphones" and full-text search misses "Bluetooth earbuds" — same product, different words. Switch to pure vector search and the opposite breaks: a customer pastes an exact SKU and gets "similar" items instead of the one row they asked for. One approach fails on meaning, the other fails on precision, and your users blame the app, not the algorithm. Hybrid search ends the trade-off: run Postgres full-text search and pgvector similarity side by side, fuse the rankings with reciprocal rank fusion, and return results that are both relevant and exact. This guide builds supabase pgvector hybrid search on your project in about twenty minutes. *Last updated: 2026-10-10* What you'll build and learn When to use vector search, full-text search, and both at once How to enable pgvector and model a documents table on Supabase HNSW vs IVFFlat: which index to pick and which parameters to set A single SQL function that fuses both rankings with reciprocal rank fusion (RRF) How to generate embeddings and call the search from Flutter via supabase_flutter Production tuning: recall, latency, cost, and row-level security Why hybrid: the two failure modes Full-text search is a lexical matcher. It is superb at exact terms — SKUs, names, error codes — and blind to meaning: "wireless headphones" never matches "Bluetooth earbuds" because no token overlaps. Vector search is the mirror image. It understands that those two phrases mean the same thing, but it has no notion of exactness: the closest vector to an SKU is merely "similar", and similarity is not identity. Hybrid search runs both and merges the rankings. The FTS leg catches the exact matches vector search would dilute; the vector leg catches the paraphrases FTS would miss. The…