Hybrid keyword and semantic search in OpenSearch

Hybrid search in OpenSearch merges BM25 keyword hits with vector hits through a search pipeline. This page covers the normalization and reciprocal rank fusion choices, the setup sequence, and how judgment lists tune the blend.

On this page

Why hybrid keyword and semantic search in OpenSearch matters for your users

Keyword search and vector search fail in different places, and your users feel both failures. Keyword search with BM25 matches the exact terms a user types, so it finds product codes, error strings, account identifiers and proper names reliably, but it misses a query that paraphrases the document. Vector search matches meaning, so it handles a question phrased in the user's own words, but it can miss an exact identifier that carries no semantic signal. Teams that run only one of the two usually discover the gap after launch, when support tickets show users searching for something the index could return but the ranking never surfaces.

Hybrid search, introduced in OpenSearch 2.11, runs both retrieval styles and combines their results through a search pipeline. The pipeline normalizes and combines scores from the keyword and vector sub-queries, so one result list reflects both signals. OpenSearch offers two combination approaches: a score-based normalization processor and a rank-based score ranker that uses reciprocal rank fusion. The choice between them is a design decision you should make before indexing, because it shapes how the query is written and how you tune it later. You need hybrid search when your corpus contains both identifiers that must match exactly and natural-language content that users will not phrase the way the documents do, such as support knowledge bases, product catalogs or internal document search. If your queries are almost all exact lookups, or almost all free-text questions, a single method may be enough, and you should confirm that with query logs from your own users before adding a second retrieval path.

How a hybrid query flows through the search pipeline

The flow starts when a client sends one user query to OpenSearch, which runs a hybrid query containing a keyword (BM25) sub-query and a k-NN sub-query. Both sub-queries run against the same index, and the search pipeline then applies a normalization processor to score-based results or a score ranker processor that uses reciprocal rank fusion. Check where the embedding model is called, since the query text must be converted to a vector before the k-NN sub-query can run, and confirm the pipeline is attached to the search request or index as you planned.

Keyword and vector sub-queries run in parallel and merge in the search pipeline.

Choosing the normalization processor or the score ranker processor

The normalization processor is score based. It takes the raw BM25 scores from the keyword query and the raw similarity scores from the vector query, normalizes each set onto a common scale, and then combines them using a weighting method you configure in the search pipeline. Because it reads the actual score values, it depends on both result sets carrying meaningful numbers. The combined ranking reflects how strong each match was, not only where it landed in each list, so a very strong keyword match can keep its lead even when the vector side is weaker.

  • Score input: The processor needs the scores themselves. Any change to a query, boost or analyzer changes the score distribution, which can shift the balance between the two sides.
  • Scale handling: BM25 scores are unbounded and vary with query length and term frequency. Vector similarity scores fall in a different range. Normalization brings both onto one scale before combining, so confirm the normalization technique and the combination weights against your own result sets.
  • Weights: The combination step accepts weights for each query clause. These are the main tuning lever, and they need evaluation data to set well.
  • Fit: This option suits teams that want precise control over the blend and can run relevance tests whenever queries or data change.
  • Operational cost: Expect recurring tuning effort after content, analyzers or embedding models change, since the score distribution moves with them.

Before you choose, check the normalization and combination options available in your OpenSearch version against the hybrid search documentation, and plan a judgment list to test the weights.

Configuration options and when each fits

This table compares the main settings on an OpenSearch hybrid search pipeline and when each choice fits. Read each row as a decision: the setting, the situation where it helps, and what it costs you. Confirm exact parameter names and defaults in the hybrid search docs for your OpenSearch version before you build.

SettingWhen it fitsTrade-off to weigh
Normalization technique (score based)Keyword and vector scores are both meaningful and you want the score magnitudes to influence the final order, for example when BM25 scores are strong signals for exact product codes.Scores from BM25 and vector queries sit on different scales and change with each query, so tuning and testing against real queries are needed before rollout.
Score combination methodUse the combination step that matches the normalization choice and your weighting intent, such as arithmetic-style blending for a simple balance between sources.The combined score depends on the normalization chosen first, so changing one without retesting can shift ranking in ways that are hard to predict.
Weights per sub-querySet a higher weight on the keyword side when users search by names, identifiers or exact terms, or a higher weight on the vector side for natural-language questions.Weights are set by hand. Without a judgment list to measure against, they become guesses that fit a handful of examples.
Score ranker with reciprocal rank fusionChoose it when keyword and vector scores are hard to compare, or when you want the result position in each list to drive the outcome rather than raw score values.It ignores how strongly a document matched, so a near-perfect keyword hit and a weak one can end up with similar weight if they share a rank position.
Rank constant for reciprocal rank fusionA lower constant gives top-ranked results in each list more influence, while a higher constant smooths the contribution across lower positions. Keep the default until your judgment list shows a reason to change it.Small changes can reorder results in the middle of the list. Confirm the parameter name and default for your version in the docs.
Result size per sub-queryRequest enough results from each side that fusion has overlapping candidates to work with, and keep it small enough to hold latency within your service targets.Larger sizes raise query cost and can add low-quality candidates. Smaller sizes can drop a relevant document that only one side ranks highly.
Search pipeline version and testsPin the pipeline definition in version control and re-run your judgment list after each OpenSearch upgrade, since the processors and their behavior can change across minor releases.Each pipeline change needs a retest cycle, which adds ongoing effort for the team that owns the search index.

How to set up a hybrid search pipeline

This sequence takes an OpenSearch cluster from a version check to a working hybrid query, with a check at each step so you know each piece returns what the next one needs. The result is a tested keyword and vector search path you can review before any application depends on it.

  1. Confirm the OpenSearch version supports hybrid search

    Hybrid search was introduced in OpenSearch 2.11, so the first check is that your cluster runs that version or later. Your platform team confirms the running version on every node and checks it against the maintenance status in the OpenSearch releases documentation, since a version in maintenance receives fixes but no new features. Confirm the version is supported in your own change window before you build anything on it. Done means the cluster reports a version at or above 2.11 and your team has written down the version and its support end date.

  2. Create a k-NN index with text and vector fields

    Create an index that holds a text field for BM25 keyword matching and a knn_vector field for embeddings, with the k-NN setting enabled in the index settings. The vector dimension must match the output size of the embedding model you chose, so confirm that dimension with the model's documentation before you create the mapping. Your search engineer sets analyzers for the text field to match your language and content. Done means the index exists, the mapping shows both fields with the expected types, and a small test document indexed with a vector returns when you fetch it by ID.

  3. Connect or deploy the embedding model

    Decide whether embeddings come from a model hosted inside the cluster or from an external model connector that you operate inside your network. Either way, the model must be registered and deployed through ML Commons, and the same model must embed both documents at index time and queries at search time. Your team tests a short sentence through the model endpoint and confirms the returned vector length matches the index mapping. Done means the model reports a deployed state and a test embedding has the correct number of dimensions.

  4. Define the search pipeline with the normalization processor

    Create a search pipeline that holds a normalization processor, which is score based, or a score ranker processor, which applies reciprocal rank fusion based on result positions. Pick the combination technique and weights in the pipeline definition, and keep the processor name and settings in version control so changes are reviewed. Choose between the two methods on your own judgment list results, not on assumption, since they rank differently when the keyword and vector scores are on different scales. Done means the pipeline is saved, GET on the pipeline returns the exact definition, and the team has a record of which processor was chosen and why.

  5. Index sample documents and run a hybrid query

    Load a representative set of documents, with the embedding generated for each one at index time through the model, then run a hybrid query that contains a keyword sub-query and a neural sub-query inside one hybrid clause. Send the request with the search pipeline parameter so the processor combines the two result sets. Use a query text that you know should match both exact terms and meaning, so both kinds of result are expected. Done means the request returns hits without errors and the response shows the pipeline was applied.

  6. Verify both sub-query scores appear in results

    Inspect the response for evidence that both sub-queries contributed. Each hit should show a combined score, and a query that names an exact term should surface a document that only matches on keywords, while a paraphrase query should surface a document that only matches on meaning. If one sub-query returns nothing, check the field names, the analyzer and the model deployment state before changing weights. Done means you can point to at least one hit that ranked well through the keyword path and one through the vector path.

  7. Run sample queries against a judgment list

    Build a judgment list of queries with the documents a reader should see for each one, then run every query through keyword only, vector only and the hybrid pipeline. Compare the ranking each method produces against your judgments and record where the hybrid pipeline improves or degrades results. Adjust weights or switch processors only when the comparison shows a clear reason, and rerun the full list after each change. Done means your team holds a saved comparison that shows the hybrid result against both single-method baselines and records which setting was kept.

Tuning the blend with judgment lists

A judgment list is the test set that tells you whether a hybrid pipeline actually ranks better than keyword search alone. It pairs a set of representative queries with graded relevance labels for the documents a search should return for each one, typically on a simple scale such as irrelevant, partially relevant and highly relevant. Without one, changes to the normalization technique, the combination weights or the ranker are judged by whoever happens to try a few queries, which is how a blend tuned for one popular query quietly degrades the long tail. Build the list before you change the pipeline, and keep it under version control so every later comparison uses the same labels.

Source the queries from your own search logs first, choosing a mix of frequent, rare and zero-result queries, then have subject matter experts rate the top results for each. Labeling is the largest effort in this work and it recurs: every new content type, index mapping change or embedding model change can shift the results enough to require relabeling. Ask whether the labels will come from in-house reviewers or a partner, how many reviewers rate each query, and how disagreements are resolved. Your team owns the decisions about relevance, so a partner can build the harness and run the labeling workflow, but the grading rules should come from the people who know the content.

Run the same judgment list against three configurations: a BM25-only query, a vector-only query, and the hybrid pipeline. Change one thing at a time, such as the normalization technique, the weight split between keyword and vector scores, or the ranker, and rerun the full comparison before changing the next. Record the configuration with each run so you can explain later why a result moved. Confirm the metric names and any evaluation tooling you plan to use against the current OpenSearch documentation, and check that the evaluation harness uses the same pipeline, index and query settings that production uses, or the comparison will not reflect what users see.

Security and access considerations for hybrid search

Hybrid search sends the same user query through a keyword path, a vector path and an embedding model, and each of those paths needs its own access decisions. The cards below cover the controls that have to hold across all of them, from document filtering to logs of what users searched for.

Document and field security on both paths

Confirm that document-level and field-level security roles apply to the BM25 sub-query and the k-NN sub-query alike, since the pipeline merges their results. Test with a user who should not see a restricted document and check that it is absent from the fused result list, not only from the keyword hits. Field masking should be verified on the vector field too, so that a user cannot infer restricted content from stored embeddings returned in the response.

Security plugin docs

Access to the embedding model endpoint

The query embedding is produced by a model endpoint that the search pipeline calls on every request, so it is a service with its own access path. Limit which roles and service accounts can invoke the model connector, and keep the connector credentials out of user-facing roles. Ask who can change the model endpoint, since a silent swap changes ranking for every query.

TLS and roles for pipeline management

Search pipelines control how scores are normalized and combined, so creating or editing them is a change to ranking behavior. Restrict pipeline creation and update rights to a small admin role, and require TLS for node and client traffic so that query text and results are protected in transit. Review who holds cluster-level permissions, because those roles can change pipelines and index settings together.

Audit logging of search queries

Hybrid queries often contain free text that users type about customers, cases or internal projects. Decide whether audit logs should capture search requests, which categories of index they cover, and how long they are kept. Check that logs of hybrid queries are readable by the security team but not exposed to every search user, and confirm the retention period with your compliance owner.

Keeping embedding inputs in your network

Documents and queries are sent to the embedding model to produce vectors, so an external embedding API would move that content outside your boundary. Keep the model in your infrastructure or an approved private endpoint, and confirm where indexed text and query text go at each step. Record the model version used for indexing so that query and document vectors stay comparable over time.

Questions buyers ask about hybrid search in OpenSearch

What drives the cost of a hybrid search build in OpenSearch?

The cost is driven mostly by the size and state of your content, how many search fields and languages you need, and how much judgment work goes into tuning. Scope covers the search pipeline, the index mapping for text and vector fields, the embedding step, the query templates that combine BM25 and vector clauses, and the relevance evaluation. One-time costs include design, build and the first tuning cycle. Recurring costs include the infrastructure you run, re-embedding when the model changes, and periodic relevance checks. Ask any quote to itemize these parts and state who pays for each, whether that is your team, a partner or a vendor license. OpenSearch itself is released under the Apache License, Version 2.0, so software licensing is not usually the cost driver.

How long does a first hybrid search build take?

The duration depends on how clean your data is, how many fields and document types feed the index, whether your embedding model is already chosen and hosted, and how many rounds of relevance tuning you want before launch. A build with one corpus, one model and a small set of queries is shorter than one that spans several indices, languages and access rules. Ask for a timeline that separates discovery, the first working pipeline, the judgment list review and the production cutover, and confirm which of those steps depends on your team's availability. Any figure you receive should come from the written scope for your environment, not from a general estimate.

What does the work need from our team?

Expect to supply several things before the build starts:

  • Access to a test cluster and a representative sample of documents, with the fields that users search and filter on.
  • A named owner who can decide ranking priorities and approve the judgment list.
  • Someone who knows your data classification rules, so that embeddings and stored text follow them.
  • Network and identity contacts who can open the paths between OpenSearch, the embedding service and your application.

The work also needs realistic example queries from real users, because those drive the judgment list that tunes the blend of keyword and semantic scores.

Can our internal team build hybrid search without a partner?

Yes, a capable internal team can build hybrid search, since the feature is part of OpenSearch and the search pipeline is configured through the cluster's own APIs. The harder parts are usually the judgment list, the choice between score-based normalization and reciprocal rank fusion, and operating the cluster after launch. Ask yourself whether your team has time to run relevance experiments, has experience with embedding models and has an on-call path for the search cluster. If one of those is missing, a fixed-scope engagement can cover the gap. DeployOpen plans, implements and documents self-hosted platforms in your own infrastructure, so ownership stays with you either way.

Does hybrid search need a dedicated ML node?

Not necessarily. Hybrid search combines the results of a keyword query and a vector query through a search pipeline, and the vector side needs embeddings for the query and the documents. Whether you need a dedicated machine learning node depends on where the embedding model runs. If the model runs outside the cluster, for example in a separate inference service inside your network, the search nodes do not need that role. If you host models inside OpenSearch, plan dedicated ML capacity so that embedding work does not compete with query and indexing load. Confirm the model placement and its capacity requirements with your platform team before you size the cluster.

How does hybrid search differ from neural sparse search?

Hybrid search keeps BM25 keyword scoring and adds dense vector retrieval, then merges the two result sets in a search pipeline. The normalization processor combines scores, and the score ranker processor uses reciprocal rank fusion based on result positions. Neural sparse search instead produces sparse, term-weighted vectors that can run on rank features and behave more like keyword retrieval. Hybrid search suits teams that already have BM25 relevance they value and want to add semantic matching beside it. Neural sparse search suits teams that want semantic retrieval without dense vectors. Many projects test both before choosing, and the judgment list is the fairest way to compare them on your queries.

Which ranking method should we choose, normalization or reciprocal rank fusion?

Choose based on whether your scores are comparable and how much you want to control the blend. The normalization processor is score based, so it keeps the magnitude of each score, which lets you tune the weight between keyword and semantic results directly. Reciprocal rank fusion, provided by the score ranker processor, uses only result positions, which avoids problems when BM25 and vector scores sit on very different scales. Test both against the same judgment list, check how sensitive results are to small weight changes, and document the choice so that future model or index changes can be re-tested against it.

Operating hybrid search after go-live

Hybrid search needs ongoing operation because three things change after launch: the documents, the embedding model and the OpenSearch version. Treat the judgment list as a regression suite. Re-run it after every bulk content change, every change to the normalization-processor or score-ranker-processor settings, and every embedding model swap, and compare the nDCG or other chosen metric against the last accepted baseline before promoting a change. Keep the query sets, relevance labels and pipeline definitions in version control so that a regression can be traced to a specific change. Confirm with your search team which metric and cut-off they will use, since the judgment list only helps if the team agrees on what a drop means.

Plan upgrades inside the maintenance window that applies to your version. OpenSearch versions receive bug fixes and security patches but no new features during maintenance, and the release page states when each version leaves maintenance, so check that date before scheduling. Hybrid search depends on the search pipeline, so after each upgrade run the judgment list and a smoke test of both the keyword and the neural clauses. Confirm that the pipeline definition still loads and that the processors behave the same on the target version, because a silent change in score handling can shift rankings without any error. Keep a snapshot of the cluster and the pipeline definitions before each upgrade so you can roll back.

Monitor query latency for the hybrid path separately from keyword-only traffic, since the neural clause and the pipeline add work per request. Alert on pipeline errors and on queries that return only one of the two result sets, which often means an embedding call failed and the search quietly degraded to keyword ranking. Embedding model updates are the most disruptive change: vectors produced by different models are not comparable, so a new model normally means building a new index, reindexing the corpus with the new model, running the judgment list against the new index, and then switching the search alias. Ask your team to confirm how long a full reindex takes at your corpus size and whether the old index can stay live until the switch.

How DeployOpen scopes and delivers hybrid search

DeployOpen plans, builds and hands over hybrid keyword and semantic search on OpenSearch inside infrastructure you control. Each engagement starts with a written scope covering the indexes, search pipelines, embedding setup, access controls and the relevance tests that decide between normalization and rank fusion.

How we scope

  • Written scope lists the indexes, text fields and vector fields that hybrid queries will search together.
  • Scope names the OpenSearch version, the search pipeline design and whether score normalization or rank fusion is in use.
  • Scope records the access model, including roles, document-level and field-level controls that apply to search results.

How we build

  • We configure the search pipeline with the normalization processor or the score ranker processor, based on your evaluation results.
  • We connect the embedding model your data uses and confirm that query-time and index-time embeddings match.
  • We test hybrid queries against a judgment list built with your domain experts, then tune weights and fusion settings from those results.

How we hand over

  • Handover includes the pipeline definitions, index mappings and query templates in version-controlled files your team can review.
  • Documentation records the tuning decisions, judgment list results and the reasons behind the chosen fusion method.
  • Your team receives a walkthrough covering how to add judgment cases, rerun relevance checks and change pipeline settings safely.

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • Ongoing support, OpenSearch upgrades and continuous testing are available as a retainer, which covers relevance regressions after version changes.
  • Ask us to confirm which OpenSearch version your upgrade plan targets, since pipeline behavior can change between releases.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.