Expand description
Parsed recall query: the single owner of the query→atoms mapping shared by the DB prefilter and the nucleo fuzzy stage.
The invariant this module exists to hold in one place: the LIKE
conditions from like_patterns() must accept every row the nucleo
pattern from scoring_pattern() can match (the prefilter is a strict
superset of the fuzzy stage). Both sides derive from the same
normalization and the same atom split, so they cannot drift apart.
Known bounded exception: nucleo’s Normalization::Smart folds accented
haystack chars onto ASCII query chars (cafe matches café); a byte-wise
LIKE cannot express that, so a haystack whose only match is via folding
can still be prefiltered away. Non-ASCII query chars are simply not
required by the prefilter (requiring less always preserves the superset).
Structs§
- Recall
Query - A recall query parsed once into nucleo-style atoms.
Functions§
- atomize 🔒
- Split a normalized query into atoms the way nucleo’s
Pattern::parsedoes: unescaped whitespace separates atoms,\keeps a space inside one. Backslashes are preserved forrequired_charsto resolve, so a trailing\$is still distinguishable from a suffix anchor. - is_
recall_ separator - Characters treated as word separators in recall search.
-covers flag forms (--release),*covers glob queries, and/covers path components so a match after any of them scores like a whitespace boundary rather than nucleo’s (lower) delimiter boundary. - is_
subsequence 🔒 - Whether
needle’s chars appear inhayin order, ignoring ASCII case (matching LIKE’s NOCASE collation). - like_
pattern 🔒 - Build a LIKE pattern matching
requiredas an ordered subsequence: “gcm” becomes “%g%c%m%”. - normalize_
recall_ char - Map separator chars to space so nucleo treats them as word boundaries; pass through everything else.
- required_
chars 🔒 - The chars one positive atom requires the haystack to contain in order,
with fzf-style operators stripped (
^/'prefix, unescaped$suffix) and escapes resolved.Nonefor negated atoms and atoms that reduce to nothing. Non-ASCII chars are dropped: nucleo may satisfy them via Unicode folding that LIKE can’t express, and requiring less keeps the superset.