Yes. pgvector supports hybrid keyword and semantic search by pairing its vector-similarity retrieval with PostgreSQL full-text search. The pgvector project documents this approach and shows combining the two result lists with Reciprocal Rank Fusion (RRF) or using a cross-encoder.
What “hybrid search” means in PostgreSQL
Hybrid search combines two kinds of retrieval. PostgreSQL full-text search finds documents based on words and their relationships in the text; pgvector finds documents whose stored embeddings are close to a query embedding. The application can then combine or rerank candidates from both paths.
As an Amazon Associate I earn from qualifying purchases.
It is a documented combination of PostgreSQL features, not a single special pgvector operator. The pgvector README recommends using it together with PostgreSQL full-text search for hybrid search: pgvector README.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →What each search path contributes
Keyword search: PostgreSQL full-text search
PostgreSQL represents searchable document text as a tsvector and a parsed search query as a tsquery. The @@ operator checks whether the document matches the query. For relevance ordering, ts_rank_cd scores matches using a cover-density approach. PostgreSQL documents these types, operators, and ranking functions in its full-text search introduction and query and ranking controls.
#1 Best Overall
For query conversion, plainto_tsquery turns plain text into a query, while websearch_to_tsquery supports a more familiar, forgiving web-search style of input. The choice affects how user-entered words and operators are interpreted; it does not replace semantic retrieval.
Semantic search: pgvector
Store an embedding for each document in a pgvector column, then compare it with an embedding of the user’s query. The project’s hybrid-search example orders candidates by cosine distance using the <=> operator and takes a top-ranked set. Smaller distance indicates a closer match for this ordering. See the pgvector README and examples.
Rank #2
How to build a hybrid retrieval flow
- Store shared records. Keep document text, an identifier, and its embedding in PostgreSQL. Both retrieval paths need an identifier they can use to recognize the same document.
- Retrieve lexical candidates. Convert the user’s text query with a suitable function such as
plainto_tsqueryorwebsearch_to_tsquery; match with@@and, if useful, order matches usingts_rank_cd. - Retrieve semantic candidates. Embed the query and order documents by vector distance, for example cosine distance with
<=>, limiting the result to a candidate set. - Combine or rerank candidates. Join results by document ID and use RRF to combine their ranks, or use a cross-encoder as a reranking option. The project’s Python example demonstrates separate keyword and semantic result lists and sums reciprocal-rank contributions for documents appearing in them.
The pgvector README’s example and hybrid-search guidance are available in the project documentation. PostgreSQL describes full-text query conversion and ranking in its text-search controls documentation.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Choosing how to combine results
| Approach | What it does | What the documentation establishes |
|---|---|---|
| Reciprocal Rank Fusion (RRF) | Combines the positions of documents across separate ranked lists, adding reciprocal-rank contributions for matching document IDs. | The pgvector README includes a Python example. It does not establish that RRF is best for every corpus or workload. |
| Cross-encoder | Provides another way to score or refine candidates from retrieval. | The README names it as an option, but the cited materials do not quantify its quality or performance against RRF. |
Evaluate candidate quality using the kinds of queries and documents your application actually handles. The official example documents a practical pattern, not a universal ranking guarantee or a benchmark comparing fusion methods.
Rank #3
Indexing and workload considerations
PostgreSQL says text-search indexes are optional but usually desirable when a text-search column is searched regularly. Which index to use, and how to tune vector retrieval, depend on the corpus and workload; the hybrid-search example does not benchmark those choices. Consult PostgreSQL’s text-search index documentation and measure the behavior of your own application.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




