How do you do hybrid search with pgvector?
RAG & Vector DB Interview: pgvector HNSW, IVFFlat, Index Tuning, Postgres RAG
Audio flashcard · 0:27Nortren·
How do you do hybrid search with pgvector?
0:27
Hybrid search in pgvector combines vector similarity with PostgreSQL full-text search using tsvector and ts_rank. Create a tsvector column and GIN index alongside the vector column, run both a vector query and a full-text query, then combine scores either with weighted sum in SQL or with Reciprocal Rank Fusion. Postgres's Common Table Expressions make the RRF query readable. This gives the same hybrid-search benefits as purpose-built databases but requires manual query construction rather than a single API call.
github.com