- The numbers are the engine’s.
p,distandscoreare the engine’s raw output. Once a judgment has enough outcomes (100, with at least 20 of each kind) and a fit that beats the raw numbers on outcomes it was not fitted on, each answer also carries acalibratedobject with the same fields plusstage(earlywhile the fit rests on few outcomes,fullonce it rests on many),outcomes,from_previous_epochandextrapolated. It never replaces the raw fields, and thresholds, filters and ranking use the raw fields. See calibration. - A composite judgment’s
pis combined. It comes from weights fitted on your labels, andpartsgives each part’s rawp. It has nocalibratedobject, and thresholds, filters and ranking use the combinedp. - Every answer has provenance. It names the document
revisionit was computed for, thejudgment_version, theengine_versionand theevaluation_id, so you can always see how it was produced. When a change leaves the compiled context the same, the answer is reused for the new revision without calling the engine:revisionmoves on, andevaluation_idandevaluated_atstill name the earlier evaluation that computed the numbers. - The answer of a judgment with relations has a
watermark, the position in the namespace’s log its context was read at. Every write at or below it, to the document or to the documents that point at it, is reflected.revisionstill names the document’s own revision. For a relation that reads the document the judged one points at, the watermark also says which version of that document the answer read; an answer outside the judgment’s re-judge scope keeps that version after the document changes, and readsstalewithstale_reasonreferenced_changed. On a get, such an answer also listsreferenced_changes: the newest write to each document it points at that changed what the relation shows, with itsrevisionand time. One at or below the watermark is in the answer; one above it makes the answerpendingorstaleinside the scope, andstaleoutside it. Afailedanswer of such a judgment keeps its last good numbers but has nowatermark, because the failed attempt’s position does not describe them. A judgment withapplies_tohas no answer at all for the documents it does not apply to. - Relations add a few fields, each present only where it applies:
answers_generation, besidewatermark: how far the context had read other judgments’ answers and block changes. Together they are the answer’s position; a roll-up’s child answer or a block change above either makes the answerpendingorstale. Absent on afailedanswer, likewatermark.referenced_changes[].deferred:truewhile that change’s fan-out waits past the judgment’s rolling limit, andreferenced_changes[].generationwhen another judgment’s answer caused the change.previous_revision, for a recipe withprevious: the revision the previous rendering came from, absent when nothing was shown underprevious. Afailedanswer keeps the last success’s.- For a choice that chooses among candidates,
valueis the matched document’sidornone_of_the_above, anddistlists only the candidates with any probability, and the escape.
- Every answer has a freshness.
staleandfailedanswers still carry the last good numbers and the revision they were computed for, and astaleone says why instale_reason. - Numbers read as the decimals they are. Answers keep
p,dist,scoreandescape_pto about seven significant digits and return each as the shortest decimal that stands for it, so an engine’s 0.01 reads0.01, not0.009999999776482582. Named thresholds, query filters and threshold recommendations all compare that decimal, so an answer that shows 0.01 meets a threshold of 0.01 everywhere.
Querying answers
Queries filter and rank on answers like any other field:- Filters are
[field, op, value],["And" | "Or", [...]]or["Not", filter]. The operators areEq,NotEq,In,NotIn,Lt,Lte,Gt,Gte,Glob,Contains(on string arrays) andExists. - Filterable fields are
id,revision,updated_at,attributes.*, and for each judgmentp,value,score,dist.{option},escape_p,freshnessandthresholds.{name}.stateis never filterable. rank_byis one field and a direction,["updated_at", "desc"]by default.top_kis at most 1,000. Acursorfromnext_cursorfetches the next page. Cursors last 10 minutes and pin the namespace’s state, so pages are consistent with each other.more: truemeans more rows matched.answers: "fresh_only"drops rows whose included answers are notfresh.consistency: "eventual"may serve a view of the namespace up to 60 seconds old, for lower latency.- A query whose estimated scan is over 4 GB is refused with
too_largeand the estimate, and is not billed. Add attribute filters to narrow it.
on_read one, whose answers exist only once something reads them. on_change keeps every answer current, so it’s the policy to filter on; periodic and manual answers are filtered as they are stored. Using an on_read judgment in a filter returns invalid_request; switch it to on_change first, which backfills the missing answers after you confirm an estimate. Brussle never backfills silently.