Expand description
Whole-object index rows: 'F' files, 'P' profiles, 'A' actions.
§Why this is Rust and not a SQL trigger
A trigger cannot call into Rust, so what an action contributes to the index
would be capped at what json_extract can express — a hardcoded action-type
allowlist, and adding an indexable type would mean editing SQL in a storage
adapter. Instead the rules live where the action type is defined, in the
Action DSL’s search block, and are applied here on the same debounced
scheduler path that serves deep 'D' document parts.
Only the text is decided here. MetaAdapter::replace_search_row derives the
ACL columns (content_type, owner_tag, visibility, root_id,
created_at) from the source row in the same statement that writes the index
row, so the index and its source cannot disagree about who may see a hit.
The cost: a write path can forget to call schedule_object, where a trigger
could not be forgotten. The mitigations are the sweep in crate::reindex,
which converges the index from scratch, and the call sites being one line
each, immediately after the adapter call they follow.
Structs§
- Index
Object Task - Scheduled per-object index run. See the module docs.
Constants§
- OBJECT_
DEBOUNCE_ SECS - Seconds of quiet before a changed object is indexed.
- OBJ_
ACTION obj_tpfor a whole action row.- OBJ_
PROFILE obj_tpfor a whole profile row.
Functions§
- index_
action - Index one action, according to its type’s DSL
searchmanifest. - index_
action_ row - Index an action already in hand — what the sweep uses, so paging a tenant’s actions costs no second read (and no second round of profile hydration) per row.
- index_
file - Index one file’s own
'F'row. Its deep'D'parts arecrate::indexer’s job. - index_
file_ row - Index a file already in hand — what the sweep uses, so paging a tenant’s files does not re-read every one of them.
- index_
object - Index one object now, bypassing the debounce. Used by the task body and by the reindex sweep.
- index_
profile - Index one profile.
- index_
profile_ row - Index a profile already in hand — what the sweep uses.
- is_
indexable - Whether a file should have index rows at all.
- new_
action_ rules_ cache - Build an empty
ActionRulesCache, so the server crate can register one without taking aparking_lotdependency of its own. - schedule_
object - Ask for one object to be re-indexed once it goes quiet.
Type Aliases§
- Action
Rules Cache - Parsed action manifests, keyed by resolved DSL definition name.