Skip to main content

Module objects

Module objects 

Source
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§

IndexObjectTask
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_tp for a whole action row.
OBJ_PROFILE
obj_tp for a whole profile row.

Functions§

index_action
Index one action, according to its type’s DSL search manifest.
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 are crate::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 a parking_lot dependency of its own.
schedule_object
Ask for one object to be re-indexed once it goes quiet.

Type Aliases§

ActionRulesCache
Parsed action manifests, keyed by resolved DSL definition name.