DataDungeon::MatchIndex
Inherits DataDungeon::Matcher < Reference < Object
Best matches for registered types: the assets whose traits come closest to what was asked, even when none matches every pick, ranked by
score = Σ weight × similarity, over the traits asked for
where a word trait is alike only when equal, a scale's values are alike by how near they sit on it, colors by how alike they look (CIE76 ΔE in Lab), and sets by the members they share. See DESIGN-best-match.md.
Each asset gets a controlled vector built from its tags (no model, no API calls): one block per trait, so its inner product with a query's vector approximates the score. USearch finds the nearest candidates in one file per type, beside the database, and they are then scored exactly from their traits. Weights travel with the query, so changing them rebuilds nothing; changing a type's traits, scales or colors rebuilds its file from the tags.
One process owns a store's match files (a lock). Before each query it catches up on every process's writes from the database's change log; a checkpoint beside each file means a restart replays only what changed.
Constants
Colors that place the others by appearance: a color's block holds how close it is to each.
Constructors
Class methods
1 for the same color, falling off with distance: about 0.6 at sigma.
A color value's RGB: a CSS name (with or without dashes) or a hex code
(stored values lose the #).
The middle of a named direction's sector (Direction#name).
Instance methods
The assets of a registered type closest to picks (trait => value),
best first, with their scores; flagged ones are left out, and equal
scores go to the highest rating, then the newest. Traits in require
must equal their picks. weights give this query's emphasis; others come from the
registration, else 1.