How do you measure whether search finds the right passages?
To judge whether a search change helped, mark in advance the passages that settle each test question. Then run the questions through search alone and check whether those passages come back before any answer is written. A passage that search does not return cannot reach the request your application builds for the model, so the model has no wording from that passage to check or apply.
Recall at k is the fraction of all possible relevant results that appear in the first k results, where k is the number inspected.
With a small labelled set, you can measure whether the settling passages come back, how high they rank and how much irrelevant material comes with them, at a k that matches your application, and keep the labels valid when documents change.
Start with questions and marked evidence
Build on your document-answer test set. A relevance label marks the passage that supplies evidence needed to answer a particular question. Record its document, page and exact wording, including conditions or exceptions that change the answer. Accept alternative passages that supply the same evidence.
Take a traveller whose flight was cancelled by a strike and who asks whether their insurance covers it. Their policy covers cancellations but excludes those caused by industrial action, so that exclusion is the passage that settles the question.
Preserve users' original wording. One team reported on Hacker News that it relied on exact keywords too much when testing, because it knew the test knowledge base.
Measure coverage, position and noise
In Elasticsearch's ranking evaluation, precision at k is the proportion of relevant results among the first k results. Its ignore_unlabeled setting decides whether results without a label are ignored or counted as irrelevant. Neither precision nor recall accounts for position within the first k results.
With the exclusion as the only labelled target, recall at 5 is 1 when it appears among the first five results and 0 when it appears at position eight. When several passages are needed, recall is the share of them that came back.
LlamaIndex's default hit rate gives a question a hit when the identifier of any returned passage matches an expected one. Average those hits across questions. Its granular hit rate divides the number of matching returned passages by the number of expected passages. A default hit can therefore coexist with missing evidence when a question needs several passages.
Mean reciprocal rank (MRR) averages one divided by the first relevant result's position across questions, so it rewards finding that result early. LlamaIndex's default MRR follows this first-match rule; its granular MRR averages the reciprocal ranks of all matching returned passages. All of these measures need relevance labels.
Measure at the application's cut
The cut is the number of passages your application includes in the request for the model, alongside the question; set k to that number. Also measure at a larger k.
With a cut of five, a miss among the first five but a hit at position eight shows that search found the evidence outside the cut. A different ranking or larger cut is then worth testing.
At that k, compare keyword, embedding and hybrid search using the same questions. Change one setting at a time and inspect per-question differences, including questions that worsened while the average improved.
One RAGFlow user reported correct results ranked relatively low in recall testing and actual use. The missing documents and recall collection gathers related reports.
Keep labels valid when passages change
Store the marked source wording independently of passage identifiers. When you divide documents into passages differently, map that wording onto the new passages and check that each accepted passage retains the needed evidence.
LlamaIndex's evaluation example sets passage identifiers by hand so they stay the same on every run; by default they are random. A label stored only as an identifier holds only while that identifier stays the same.
A 2026 study on 18 breast-lesion questions expanded its labels from 25 to 37 stretches of supporting text and from 36 to 51 accepted search passages, without changing the rankings. Its scores moved on labels alone.
The same questions were used to choose and evaluate the setup. The added labels came from reviewing high-ranking passages of the chosen setup that the first labels lacked, and the authors note that "the audit examined retrievals from the selected configuration, potentially favoring that system in subsequent comparisons."
When document wording changes, review each label against the revised text. Store the old version and its labels with earlier runs, so a score that moves can be traced to the wording, the labels or the search setup.
Check model-made questions and labels
Microsoft Foundry's Retrieval evaluator is for when you don't have ground truths, which Microsoft also calls query relevance labels: it uses a model to judge how relevant the returned passages are to the question. Keep that judgment separate from scores checked against marked evidence.
LlamaIndex can use a model to generate questions from existing passages. Keep real user questions alongside the generated ones.
Ragas's LLM-based Context Recall has a large language model compare the returned passages with a reference answer, which it uses in place of labelled passages. Its documentation says this makes the metric easier to use, because labelling reference passages can be very time-consuming.
OpenSearch's LLM-as-a-Judge judgments label the top results from the search configurations you choose. Documents outside those results get no judgment from that step. A judgment list can also show COMPLETED while some documents remain unrated, so check label coverage before comparing scores.
Another 2026 study compared GPT-4.1's labels with two people's labels of whether a passage contains evidence that contributes directly to answering the question. On 60 challenge cases, half drawn from passages where automated judges disagreed, GPT-4.1 agreed with one person on 73.3% and with the other on 68.3%. The study also found that retrieval scores did not robustly predict answer quality on unseen topics.
Check model-made labels against people, and retain separate tests of search and answers.
A first setup and a repeatable check
Start with real questions, marked source passages, recall at k and MRR, with k set to your cut. Label the other passages each question returns, then record precision to see how much irrelevant material comes with the evidence. Save each question's returned passages and positions.
Rerun after changes to documents, passage division, search method or k. Read the misses and changed results, check that their labels still apply, and use those cases to decide which change to keep.
Join the waitlist: one email when there is something to try.