Nullean.Snapshots.Relevance
0.23.0
See the version list below for details.
dotnet add package Nullean.Snapshots.Relevance --version 0.23.0
NuGet\Install-Package Nullean.Snapshots.Relevance -Version 0.23.0
<PackageReference Include="Nullean.Snapshots.Relevance" Version="0.23.0" />
<PackageVersion Include="Nullean.Snapshots.Relevance" Version="0.23.0" />
<PackageReference Include="Nullean.Snapshots.Relevance" />
paket add Nullean.Snapshots.Relevance --version 0.23.0
#r "nuget: Nullean.Snapshots.Relevance, 0.23.0"
#:package Nullean.Snapshots.Relevance@0.23.0
#addin nuget:?package=Nullean.Snapshots.Relevance&version=0.23.0
#tool nuget:?package=Nullean.Snapshots.Relevance&version=0.23.0
Nullean.Snapshots.Relevance

Search-relevance snapshots for Nullean.Snapshots, on judy: run a judgement set against your search code, fail on a gate, and keep the scorecard and the rank of each query's first relevant result as a snapshot. A difference that is only noise passes. A real regression fails.
Install
dotnet add package Nullean.Snapshots.Relevance
Quick start
using AwesomeAssertions;
using Nullean.Judy.Running;
using Nullean.Snapshots.Relevance;
using Nullean.Snapshots.TUnit; // [RelevanceFiles]
public class SearchRelevanceTests
{
[Test]
[RelevanceFiles] // one case per relevance/*.judgements.yaml
public async Task Holds(SnapshotFile file)
{
var target = new DelegateTarget("app", async (request, ct) =>
{
var ids = await MySearch.FindAsync(request.Query, request.Size, ct); // your code
return new SearchOutcome([.. ids.Select(id => new Hit(id, null, null, null))], null);
});
var report = await RelevanceRun.RunAsync(file.Path, target);
report.Should().PassItsGates(); // the gates in the judgement set
report.Should().MatchRelevanceSnapshot(); // .snapshots/relevance/{set}.{target}.verified.yml
}
}
A judgement set says which pages answer each query, and which numbers must hold (gates:). See the judy docs.
A query is one line in the snapshot, salon chair: [2, 0.6309], with the positions named once by a columns: [first, ndcg@10] header: the rank of its first relevant result (~ when there is none), the main metric, and stale or failed when that applies. The snapshot is compared as a tree by query: $.results["salon chair"][0]: 2 → 5. When it differs, the format decides:
- Noise passes. The assertion passes, the received file is written, and a note prints the move (
ndcg@10 0.712 → 0.698 (-0.014): 3 better, 5 worse, p = 0.31).snap reviewaccepts it. - A real regression fails. The drop in the main metric is significant in judy's paired randomization test (p < 0.05).
- A change to the set always fails. Queries added or removed, or a failed search, must be accepted on purpose.
Documentation: https://snapshots.nullean.net/formats/relevance/
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- Nullean.Judy (>= 0.2.0)
- Nullean.Snapshots (>= 0.23.0)
- Nullean.Snapshots.AwesomeAssertions (>= 0.23.0)
- Nullean.Snapshots.Yaml (>= 0.23.0)
-
net11.0
- Nullean.Judy (>= 0.2.0)
- Nullean.Snapshots (>= 0.23.0)
- Nullean.Snapshots.AwesomeAssertions (>= 0.23.0)
- Nullean.Snapshots.Yaml (>= 0.23.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.