liveBook · Manning

Lexical search

As explained in Enterprise RAG

Keyword search retrieves records by matching query terms against indexed text or metadata.

Lexical search retrieves records by matching query words or phrases in standard text search. For a query such as “Dubious Parenting Advice,” it can find literal or partial matches that semantic search may overlook. Production retrieval commonly combines both strategies: lexical matching preserves exact wording, while vector search captures related meaning. section 3.2.7 section 1.1

A hybrid retrieval workflow uses lexical search as one stage in a broader search pipeline:

  • Rewrite an informal question into focused search terms, such as converting “What’s the warranty on my X24 blender?” into “X24 blender warranty.” section 1.1
  • Submit the refined text query alongside a vector query so literal matches and semantically related records are retrieved together. section 3.2.7
  • Merge and rank the returned hits before passing relevant results to downstream answer generation. section 3.2.7 section 1.1
  • Prompt for clarification or rephrasing when retrieval returns nothing relevant. section 1.1

Finding a closely titled product record

Searching for “Dubious parenting advice” with both text and vector retrieval returns a record titled “Dubious Parenting Tips,” demonstrating how lexical matching and semantic similarity can complement one another. section 3.2.7

How Enterprise RAG covers it

How deep it goes
Implements a hybrid query and ranking workflow but stops short of explaining text-index internals or ranking algorithms.
Examples
Uses “Dubious Parenting Advice,” “X24 blender warranty,” and the returned “Dubious Parenting Tips” record as concrete search examples.
What it assumes
Assumes an AI Search index and query text, while introducing query rewriting and hybrid lexical-vector retrieval.
What you can do after
Apply it via Azure AI Search to submit text and vector queries, retrieve records, and combine their results.
How it connects
Connects keyword search with vector search, semantic search, query rewriting, result filtering, and RAG.

Also explained in

Compare how 14 books explain lexical search →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Enterprise RAG. The section links point to the parts of the book it draws on.