SEARCH & AI / 008

AEM + Elasticsearch + Vector Search: Hybrid Retrieval

An engineering note on combining lexical and semantic retrieval over AEM content, and the relevance, freshness and governance questions to validate.

SHARE
LinkedIn X Facebook Threads

Topic map

Two signals, one ranked set

AEM Elasticsearch hybrid search

  1. 01Query
  2. 02Lexical / vector
  3. 03Fusion
  4. 04Authorization
  5. 05Evidence

SYSTEM OVERVIEW

SYSTEM / FLOW

Lexical and semantic candidates are complementary signals.

Conceptual hybrid retrieval. Apply mandatory scope constraints to both branches and recheck before exposing evidence.

LEXICALQuestion + exacttermsElasticsearchlexical queryScoped rankedcandidatesSEMANTICQuestionembeddingVector queryScoped rankedcandidatesCOMBINED PATHRank fusionPermissionrecheckOptionalrerankingEvidence set

Lexical

  1. Question + exact terms
  2. Elasticsearch lexical query
  3. Scoped ranked candidates

Semantic

  1. Question embedding
  2. Vector query
  3. Scoped ranked candidates

Combined path

  1. Rank fusion
  2. Permission recheck
  3. Optional reranking
  4. Evidence set

THIS ARTICLE EXPLORES

  1. Keep exact-match and semantic retrieval distinct.
  2. Compare rank fusion with a lexical baseline.
  3. Inspect filtering before and after candidate selection.

01 / PROBLEM

Exact identifiers and paraphrases fail differently.

A product code can need precise lexical matching while a paraphrased question may benefit from semantic similarity. Evaluate both classes of query instead of assuming one ranking method can replace the other.

Question families
InputEvidence soughtFailure signal
Exact identifierThe named entity or document.Semantically similar but incorrect identifier.
ParaphraseA passage expressing the same intent.No shared terms means a missed source.
Ambiguous questionEvidence sufficient to disambiguate.Confident selection without context.

02 / HYBRID RETRIEVAL

Fuse ranks deliberately.

Lexical and vector scores do not automatically share a meaningful scale. Rank fusion combines their ordering; score combination needs calibration. Elastic documents reciprocal rank fusion as one hybrid approach. Check the target version and feature availability before choosing a query contract.

An evaluation boundary

Run each variant against the same labeled question set.

  1. 01Lexical baseline
  2. 02Semantic baseline
  3. 03Combined ranking
  4. 04Review disagreements
  5. 05Choose candidate budgets

03 / PERMISSIONS

Filtering changes recall as well as access.

Enforce identity-derived scope and locale constraints where candidates are generated. A post-filter that removes most of a small candidate set can leave an otherwise answerable question with no evidence. Increasing candidate budgets is not permission to disclose restricted passages.

Filter placement
PlacementBenefitCheck
During candidate generationSearch within the allowed population.Actual engine prefilter semantics.
After mergeEnforce a shared result contract.Insufficient surviving candidates.
Before external rerankingKeep restricted text outside model payloads.Payload-level negative tests.

04 / EVALUATION

Save disagreements, not only aggregate scores.

Retain query IDs, corpus revision and ranked source IDs for review. Categorize whether a miss came from ingestion, candidate generation, fusion or reranking. Do not hide a permission error inside an average relevance score.

Illustrative comparison record

JSON
{
  "questionId": "q-example",
  "corpusRevision": "snapshot-example",
  "expectedSources": [
    "guide-example"
  ],
  "runs": [
    {
      "strategy": "lexical",
      "rankedSources": []
    },
    {
      "strategy": "semantic",
      "rankedSources": []
    },
    {
      "strategy": "hybrid",
      "rankedSources": []
    }
  ],
  "review": "Populate from an actual experiment; no scores claimed."
}

05 / TRADEOFFS

Keep a simpler rollback path.

Hybrid retrieval adds model and indexing dependencies. Preserve a tested lexical fallback only where its authorization and freshness guarantees are equivalent; an unfiltered fallback is not an acceptable degradation.

Before widening the experiment

  • Review exact-name and paraphrase disagreements.
  • Test restrictive scopes and empty-result cases.
  • Measure retrieval and reranker costs independently.
  • Verify every fallback enforces the same policy.

REFERENCE DESK

Sources & further verification

Product behavior should be checked against the target AEM and search-engine release. The design choices in this note are proposed assessment criteria, not vendor guarantees.

SHARE THIS NOTE

Found this useful? Share it with someone working on AEM, platform engineering or search.

SHARE
LinkedIn X Facebook Threads

CONTINUE THE THREAD

Related engineering notes

Related engineering work