Choose the retrieval mode: keyword, vector, hybrid, semantic ranker or external re-ranker¶
Draft outline: not validated
Drafted with AI from official sources on 16 Oct 2026. Do not use on a live system until it is written, dry-run by someone other than the author and signed off (planned 2026-12-04). Author: Deeparani · dry-run: Gayathri Ramachandran · sign-off: Prasanna. Work items: RAG-08-T01, RAG-08-T02, RAG-08-T03, RAG-08-T04.
1. Summary¶
At design time for a new corpus, or when retrieval quality is poor and the team is debating whether to add a re-ranker.
Risk: Low (design decision; a poor choice shows up as weak relevance or extra cost, not an outage). Typical duration: Half a day to decide, 1-2 days with a benchmark.
2. When to use and when not to¶
Use it when: At design time for a new corpus, or when retrieval quality is poor and the team is debating whether to add a re-ranker.
Do not use it when: to be written by the author.
3. What you must know first¶
- Hybrid search merges keyword and vector results with Reciprocal Rank Fusion (RRF)
- Vector weighting multiplies a vector query's contribution to RRF; the default is 1.0
- Semantic ranker re-scores only the top 50 results and reports @search.rerankerScore from 0 to 4
- Semantic ranker is billed per query when the search string is not empty
- An external re-ranker such as Cohere Rerank adds a network call and a per-call cost
- Full-text recall in hybrid queries stops at 1,000 matches by default; maxTextRecallSize (preview) raises it
4. Options¶
Outline of the decision process; the author describes each option.
- Classify the corpus and queries: exact terms and codes, natural language, or mixed.
- Start from the default: hybrid (keyword plus vector) with semantic ranker.
- Benchmark keyword only, vector only, hybrid, and hybrid with semantic ranker on the labelled queries.
- Add an external re-ranker only if hybrid with semantic ranker misses the agreed target.
- Compare quality gain with added p95 latency and cost per 1,000 queries.
- Record the decision and the numbers in the decision table.
- Revisit when the corpus type, languages or query mix change.
Draft snippet: Hybrid query with a text vector query and semantic ranking (POST /indexes/{index}/docs/search)
{
"search": "parental leave for contractors",
"vectorQueries": [
{
"kind": "text",
"text": "parental leave for contractors",
"fields": "contentVector",
"k": 50,
"weight": 1.0
}
],
"queryType": "semantic",
"semanticConfiguration": "default",
"captions": "extractive",
"select": "id, title, chunk",
"top": 10
}
Snippets to add:
snippets/search/queries/hybrid-semantic.json: Hybrid query with semantic ranker (json)snippets/decisions/retrieval-mode.md: Retrieval mode decision table (markdown)snippets/eval/benchmark_modes.py: Benchmark the four modes (python)
5. Decision table¶
| Situation | Choose | Why |
|---|---|---|
| to be written |
6. Recommended default and when to deviate¶
To be written by the author from the outline above.
7. Known issues and fixes¶
| Symptom | Likely cause | Fix |
|---|---|---|
| Exact part numbers or codes are missed | Vector-only retrieval does not match rare tokens reliably | Use hybrid so keyword matching catches exact terms, and give codes a field with a suitable analyser. |
| Semantic ranker gives no gain | Semantic configuration lists fields in the wrong priority or very long fields | Put title and key content first; input beyond the token limit is ignored. |
| Latency budget exceeded after adding a re-ranker | Too many candidates re-ranked per query | Re-rank a smaller candidate set and measure p95 again. |
8. Monitoring and alerts¶
| Signal | Alert when | Action |
|---|---|---|
| SearchLatency platform metric | Above the agreed budget for 15 minutes after a ranking change | Reduce candidate count or revert the change. |
9. AWS and open-source equivalents¶
Amazon OpenSearch Service supports hybrid search through a normalisation processor in a search pipeline, and Amazon Bedrock offers a Rerank API. With pgvector, combine PostgreSQL full-text and vector results with RRF in SQL.
10. Validation record¶
Pending. Planned dry-run scenario: A second engineer runs the four modes on a sandbox index with the labelled set. Pass: the decision table holds recall@10 and nDCG@10, p95 latency and cost per 1,000 queries for every mode, and the chosen mode is justified by those numbers.