Evaluating Search Quality in IR Systems
Apr 3, 2026

Authors

Unstructured
Unstructured

Evaluating Search Quality in IR Systems

This article explains how to evaluate enterprise search and RAG retrieval offline using relevance labels (qrels) and ranking metrics like Precision@K, Recall@K, MRR, MAP, and NDCG, then turn those scores into production decisions through a practical workflow that covers labeling, candidate sets, and query-level failure analysis. It also shows how preprocessing choices like extraction, structure preservation, chunking, and metadata directly shape these metrics, and how Unstructured helps you standardize that preprocessing into clean, structured JSON that your retrieval layer can evaluate and ship with confidence.

Offline ranking metrics for IR evaluation

Evaluating search quality in information retrieval (IR) systems is the process of measuring whether your search layer returns the right items in the right order for real queries. This means you define relevance for a set of queries, collect relevance labels, run retrieval, and compute search metrics that summarize ranking behavior.

An IR system is a system that takes a query and returns a ranked list of items that might satisfy the user's intent. This includes examples of information retrieval systems like enterprise document search, product search, ticket search, code search, and retrieval for RAG.

Offline evaluation is evaluation you run before shipping changes to production. This means you score a retrieval pipeline against a fixed test set so you can compare versions without user traffic.

The backbone of offline evaluation is a relevance judgment set. A relevance judgment is a human label that says whether a candidate result is relevant to a query, often stored as qrels (query relevance labels).

Offline metric evaluation only works when the test set reflects production. This means your queries, your candidate documents, your filters, and your retrieval settings should match the system you actually run.

  • Key takeaway: Offline metrics are best for fast iteration because they are repeatable and cheap to run.
  • Key takeaway: Offline metrics can mislead when your labels, documents, or chunking do not match production reality.

Precision@K and recall@K for binary relevance

Precision@K is the fraction of the top K results that are relevant. This means precision tells you how clean the first screen of results is for a given query pattern.

Recall@K is the fraction of all relevant items that appear in the top K results. This means recall tells you whether your system is missing important documents even when users scroll.

These are the classic precision and recall definitions in information retrieval, and they are easiest to use when relevance is binary. This means each result is labeled relevant or not relevant, with no middle category.

Precision and recall move in opposite directions when you change retrieval breadth. This means adding more candidates can raise recall while lowering precision, and aggressive filtering can raise precision while lowering recall.

Use precision when your product punishes false positives. This means support agents, auditors, and policy search users need results that are correct on first click.

Use recall when your product punishes false negatives. This means investigation, compliance, and research workflows need coverage even if ranking is imperfect.

  • Key takeaway: Precision@K tells you how much noise you are showing.
  • Key takeaway: Recall@K tells you how much relevant content you are failing to retrieve.

MRR@K for first relevant result

Mean reciprocal rank (MRR) is the average of the reciprocal of the rank position of the first relevant result. This means MRR metrics focus on how quickly a user can find one correct target.

MRR aligns with navigational intent. This means queries that seek a specific page, runbook, policy, or ticket should be evaluated by how often the first relevant result appears near the top.

MRR can hide problems when users need multiple supporting documents. This means a system can score well by finding one relevant chunk while still burying other required context.

Use MRR when your product experience is “find the single right thing fast.” This means it maps to click-first behavior and reduces time-to-answer.

MAP@K for overall ranking quality

Mean average precision (MAP) is the mean of average precision scores across queries. This means MAP rewards systems that rank relevant items early while still measuring the full ranked list.

Average precision is computed by looking at precision at each rank where a relevant item appears, then averaging those values. This means you get a score that prefers “relevant early” rather than “relevant somewhere.”

MAP fits informational intent where users want several good results. This means it is often a better target than MRR for research-style enterprise search.

MAP becomes brittle when relevance labels are incomplete. This means missing judgments can penalize a system for retrieving items that were never reviewed.

NDCG@K for graded relevance

Normalized discounted cumulative gain (NDCG) is a ranking metric that supports graded relevance labels. This means you can label results as highly relevant, somewhat relevant, or irrelevant and still score the list.

Discounting is the rule that lower-ranked items contribute less to the score. This means the metric matches user behavior where top positions matter more than the tail.

Normalization compares your ranking to an ideal ordering for the same query. This means NDCG scores are comparable across queries even when the number of relevant items varies.

NDCG is the default when relevance is not binary. This means it is a good fit for content discovery, knowledge base search, and product search where “almost right” still has value.

Choosing metrics that match the job

Metric choice is an architectural decision because it encodes what failure looks like. This means you should select metrics based on user intent, latency budgets, and the cost of errors.

Goal in production | Metric focus | What you learn

First correct result quickly | MRR@K | Rank position of first relevant item

Clean top results | Precision@K | Noise level in top K

Do not miss key documents | Recall@K | Coverage in top K

Strong ranking across results | MAP@K | Early placement of all relevant items

Handle graded relevance | NDCG@K | Value-weighted ordering

This mapping keeps metric evaluation aligned with product behavior. This means you can defend changes with a clear statement of what you optimized for.

Practical evaluation workflow for enterprise search and RAG

A search evaluation workflow is a repeatable process for turning queries and labels into decisions about what to ship. This means you treat evaluation as part of your retrieval pipeline, not as a one-off analysis.

Start by writing down the unit you retrieve. This means you decide whether you retrieve full documents, sections, or chunks, because your labels must match that unit.

A query set is a curated list of queries you will use for evaluation. This means it should include common queries, hard queries, and queries that represent important business workflows.

A candidate set is the pool of items you will ask humans to judge for each query. This means you usually union results from multiple systems so you do not bias labeling toward one approach.

Relevance labeling is the act of assigning labels to query-item pairs. This means you define relevance rules up front so different raters label consistently.

After you have qrels, you run your system to produce rankings and compute offline search metrics. This means you can compare retrieval variants, embedding models, rerankers, and filtering logic under the same test harness.

Online evaluation is evaluation you run in production using behavior signals. This means you measure searcher satisfaction through outcomes like reformulations, clicks, dwell patterns, and task completion events.

Offline and online results often disagree. This means you should treat offline metrics as a gate for correctness and online metrics as the gate for product impact.

  • Supporting detail: Offline evaluation catches regressions quickly.
  • Supporting detail: Online evaluation catches mismatches between “relevant” and “useful.”

RAG adds a second dependency: generation quality depends on retrieval quality. This means you evaluate retrieval first, then evaluate whether generation grounded itself in retrieved context.

In RAG, label design becomes stricter. This means you often label "supports the answer" rather than "related to the topic," because weak context still increases hallucination risk.

How preprocessing improves retrieval quality

Preprocessing is the work that converts raw content into indexable, queryable units. This means you extract text, preserve structure, attach metadata, and create chunks that a retriever can rank.

Retrieval quality depends on what is actually in the index. This means preprocessing errors show up as lower recall, lower precision, and unstable rankings even when your retriever is sound.

Extraction accuracy is the degree to which the text in your index matches the source. This means OCR errors, dropped paragraphs, and broken reading order reduce keyword match quality and embedding quality.

Structure preservation is the ability to keep boundaries like titles, sections, and tables intact. This means your retriever can use those boundaries for scoring, filtering, and chunk assembly.

Chunking is splitting content into smaller units for retrieval. This means you trade recall and context density against index size and ranking noise.

Bad chunking creates mixed-topic units. This means a chunk can match a query term while carrying irrelevant context that degrades precision and misleads generation.

Metadata is structured fields attached to content such as source, timestamps, authors, document type, and access controls. This means you can filter, boost, and route retrieval based on stable signals rather than raw text alone.

Here is how common preprocessing failures map to retrieval symptoms:

  • Missed text: Recall drops because relevant items are not searchable.
  • Flattened tables: NDCG drops because high-value facts lose their structure and become hard to rank.
  • Merged sections: Precision drops because a single chunk matches multiple intents.
  • Missing metadata: MAP drops because ranking cannot separate near-duplicates or apply domain boosts.

Preprocessing decisions should be evaluated with the same harness as retrieval decisions. This means you re-run offline metrics whenever you change parsing, chunking, or metadata rules, because those changes redefine what retrieval can see.

From metrics to production decisions

A metric score is only useful if it tells you what to do next. This means you should connect each metric movement to a specific failure mode in retrieval behavior.

Start by inspecting per-query results, not just averages. This means you identify which query classes improved, which regressed, and which stayed brittle across runs.

Then separate retrieval failures from ranking failures. This means you check whether relevant items were missing entirely (retrieval gap) or present but buried (ranking gap).

Trade-offs are expected and should be made explicit. This means you decide when higher recall is worth lower precision, or when a better first result is worth worse tail coverage.

Use baselines to keep interpretation honest. This means you compare against a stable keyword system, a previous production version, or a fixed retrieval configuration that the team agrees represents “known behavior.”

When offline metrics improve but online signals degrade, treat the issue as label mismatch or intent mismatch. This means your qrels likely capture topical relevance while users care about task relevance and authority.

When online signals improve but offline metrics degrade, treat the issue as incomplete judgments. This means the system may be retrieving useful items that were never labeled, which is a dataset maintenance problem.

  • Key takeaway: Metrics are decision tools only when they connect to query-level failure analysis.
  • Key takeaway: Production readiness depends on stability across query classes, not on a single aggregated score.

Frequently asked questions

How do I measure search relevance when I do not have labeled data?

You measure search relevance by starting with behavior-derived query sets and labeling a small candidate pool with consistent rules. This means you build qrels iteratively and expand coverage as you see repeated query patterns in logs.

What is the difference between offline evaluation and online evaluation for enterprise search?

Offline evaluation uses qrels and search metrics to compare systems in a controlled test harness. This means online evaluation uses production behavior signals to validate that metric gains translate to better outcomes for users.

Which metric should I use when users want a single correct document such as a policy or runbook?

Use MRR@K because it measures how quickly the first relevant result appears. This means you optimize the top rank positions rather than the full list.

Which metric should I use when users need several relevant documents for investigation or research?

Use MAP@K or NDCG@K because they reward retrieving and ordering multiple relevant items. This means you reduce the risk of a system that looks good on the first click but fails on coverage.

Can I use precision and recall to evaluate vector search in a RAG retriever?

Yes, because precision and recall evaluate the result set regardless of whether retrieval is sparse, dense, or hybrid. This means the work shifts to defining relevance in a way that matches how semantic similarity is used in your product.

Conclusion and next steps

Search quality evaluation is a disciplined way to decide whether your information retrieval IR system is improving. This means you select metrics that match the job, build a labeling workflow that reflects production, and treat preprocessing as part of the retrieval architecture.

When you align labels, preprocessing, retrieval, and metrics, your evaluation scores become explainable. This means you can ship retrieval changes with confidence because you know which failure modes you improved and which trade-offs you accepted.

Ready to Transform Your Search Evaluation Experience?

At Unstructured, we know that search quality depends on what's actually in your index—and that starts with preprocessing. Our platform transforms complex documents into clean, structured data that preserves the text accuracy, table structure, and metadata your retrieval system needs to rank correctly. To build search and RAG pipelines that pass your offline metrics and deliver real production impact, get started today and let us help you unleash the full potential of your unstructured data.

Join our newsletter to receive updates about our features.