CLOUD CONCEPT

Hybrid Search

Hybrid search combines keyword-based retrieval and semantic vector retrieval to produce a single ranked set of relevant results.

Cloud Concepts Hub →

What is Hybrid Search

Keyword search finds explicit terms, identifiers, and phrases, while vector search finds content with similar meaning even when wording differs. Combining these signals can improve retrieval for enterprise search and retrieval-augmented generation, especially when queries mix exact technical details with natural-language intent.

Hybrid search uses complementary retrieval methods over the same searchable corpus. A lexical retriever, commonly using an inverted index and a scoring algorithm such as BM25, identifies documents containing relevant terms. A semantic retriever compares a query embedding with document or passage embeddings to identify similar meaning. The system combines their candidates and rankings rather than assuming either method is sufficient for every query.

Consider a support assistant answering, “How do I fix error E1047 after rotating database credentials?” Keyword retrieval can preserve the importance of the exact error code, while vector retrieval can find a troubleshooting guide titled “Restoring connectivity after password changes.” Combining both methods can retrieve evidence that either method alone might miss. Hybrid search is particularly useful for product catalogs, internal documentation, incident records, and other collections containing both specialized vocabulary and descriptive prose.

A cloud implementation usually begins with an ingestion pipeline that extracts text, divides documents into useful chunks, and records metadata such as source, tenant, version, and access permissions. Each chunk receives a stable identifier and an embedding. Search infrastructure indexes both searchable text and vectors, either in one engine or in coordinated stores. Document updates and deletions must propagate to both representations. Changing the embedding model generally requires re-embedding the corpus and rebuilding or migrating its vector index.

At query time, preprocessing can detect language, preserve identifiers, expand approved synonyms, and generate the query embedding. Use a query embedding model compatible with the document embeddings. Execute lexical and vector retrieval, often concurrently, and combine candidates by their stable identifiers. Apply authorization and required metadata constraints consistently to both retrieval paths, preferably during retrieval where supported. Filtering only after candidate selection can leave too few usable results and must never allow unauthorized passages to reach a model.

Combining rankings requires deliberate scoring. BM25 scores and vector similarity scores have different scales, so adding raw values can let one retriever dominate unintentionally. A weighted combination of normalized scores supports custom relevance tuning. Reciprocal rank fusion instead combines rank positions without requiring comparable score scales. Weights, normalization behavior, candidate counts, and business boosts should be validated against representative queries, not selected solely by intuition.

An optional reranker evaluates the query and retrieved passages together to reorder the combined candidate set. Reranking is distinct from hybrid retrieval: hybrid retrieval broadens the initial evidence pool, whereas reranking improves ordering within that pool. A reranker cannot recover a document that neither retrieval path returned. For foundation-model context augmentation, deduplicate overlapping chunks, retain source references, and select passages within the context-token budget before generation. Retrieval quality supports grounded answers but does not guarantee factual generation.

Performance tuning balances relevance, latency, and cost. Larger candidate sets and more exhaustive vector searches can increase recall but require more computation; reranking adds another inference stage. Tune approximate nearest-neighbor index parameters, shard layout, searchable fields, and candidate sizes using realistic data and concurrency. Cache suitable query embeddings or results with freshness and authorization boundaries in mind. Measure recall at a chosen cutoff, ranking quality such as nDCG, end-to-end latency percentiles, and cost per query. Hybrid search is not automatically faster or more accurate than a single retriever, and it does not mean searching across public-cloud and on-premises environments.

Key aspects of Hybrid Search

Effective hybrid search combines complementary retrievers with calibrated ranking, secure indexing, optional reranking, and measured performance tuning.

Complementary lexical and semantic retrieval

Use lexical matching for explicit vocabulary and identifiers, and vector similarity for paraphrases and conceptual matches. Their combination is useful when business queries contain both exact constraints and natural-language intent.

Candidate fusion and custom scoring

Merge results using stable document or chunk identifiers, then apply rank fusion or a calibrated combination of scores. Tune retrieval weights and business boosts against labeled queries rather than directly adding incompatible raw scores.

Optional second-stage reranking

Apply a reranking model to the combined candidate pool when improved ordering justifies the additional latency and inference cost. Retrieve enough candidates first because reranking cannot introduce missing evidence.

Consistent indexing and access controls

Keep text, embeddings, metadata, updates, and deletions synchronized. Enforce tenant boundaries and document permissions across both retrieval paths before passages are used as model context.

Workload-specific performance tuning

Adjust vector index parameters, lexical analyzers, candidate counts, query preprocessing, and concurrency to meet latency and recall targets. Test identifiers and technical terms carefully because aggressive preprocessing can remove meaningful information.

Measured relevance and context selection

Evaluate retrieval using representative business questions, relevance judgments, ranking metrics, and latency percentiles. Deduplicate results and select grounded passages that fit the foundation model's context budget.

Cloud services for Hybrid Search

Amazon OpenSearch Service can maintain lexical and vector indexes and execute the retrieval paths used by a hybrid search application. Amazon Bedrock can supply embeddings and rerank the merged candidates before selected passages become foundation-model context. For supported configurations, Bedrock Knowledge Bases manages parts of this retrieval workflow. Aurora PostgreSQL provides an alternative implementation using full-text search and pgvector, particularly when relational metadata and SQL filtering are central requirements. Choose the retrieval store according to corpus size, filtering needs, operational skills, and latency targets; these services do not all need to be deployed together.

Amazon OpenSearch Service image Amazon OpenSearch Service

Supports lexical and vector retrieval, with hybrid queries and search-pipeline capabilities for combining results on supported versions and deployments. Engineers can tune text analysis, vector indexes, filtering, and score combination to meet relevance and latency requirements.

Open Amazon OpenSearch Service →
Amazon Bedrock

Provides embedding models and reranker models that can support a hybrid retrieval pipeline. Amazon Bedrock Knowledge Bases supports hybrid retrieval for supported vector-store configurations; selecting a knowledge base alone does not guarantee that hybrid retrieval is available.

Open Amazon Bedrock →
Amazon Aurora image Amazon Aurora

Aurora PostgreSQL-Compatible Edition can combine PostgreSQL full-text search with vector similarity through the pgvector extension on supported versions. Application logic or SQL can merge candidates and implement custom scoring while keeping searchable content near relational metadata.

Open Amazon Aurora →