Expand description
Compute-side evaluation of a text request over in-house terms.
The pushed-key and pinned roads of the text_scan executor receive the
terms they must decide and evaluate them locally instead of draining the
partition’s index. Three modes, two mechanisms:
FTSbuilds a scratch in-memory index (TextIndex::create_in_ram) over the terms and runs it through the SAME schema, analyzer registration, query builder, and collector the partition index uses. Tantivy matching is per-document boolean — nothing in the match decision depends on index-global state (document frequencies affect only scoring order) — so the scratch answer equals the index answer for the same value, and no second query implementation exists to drift.PREFIX/SUFFIXare pure string tests over the bounded seeds, exactly the match the index performs on its stored fields: a document’stext_beginiscrate::doc::prefix_seedof its lexical and the query seed iscrate::doc::prefix_seedof the pattern, so a value matches iff its seed starts with the pattern’s seed; the suffix direction is the same test over the reversed seeds.
Direct evaluation is equivalent to index membership because these roads
only run inside a plan rewritten under the trust gate: the gate injects a
candidate producer only for a variable whose object-slot scans use an
allowlisted predicate, and a trusted index holds every string literal
under those predicates. For every value the executor is asked about, “this
value matches the query” and “the index returns this value” therefore
coincide. A value from outside that universe (a VALUES/BIND binding, a
non-allowlisted predicate) never reaches these roads: the rewrite declines
and the exact residual answers.
Functions§
- evaluate_
fts - Evaluate a full-text request over the in-house documents.
- evaluate_
seed - Evaluate a prefix / suffix request over the in-house documents as pure string tests (no index construction). The mode selects the direction; anything else is a caller bug.