The Object Index is derived from space files. This page describes the lifecycle for authors of indexers and tag transforms. Ordinary query entry points are on Object Index#Query.
Objects are stored in your browser’s IndexedDB, implemented as a thin abstraction layer on top of API/datastore. Objects are always attached to a particular page.
When SilverBullet detects a page change (either via the editor or based on watching the file system for changes), it will queue reindexing the page.
For each changed page, SilverBullet:
page:index event.The index.indexObjects API processes each object’s root tag and user tags. For each tag, it:
schema and mustValidate is set to true, it will validate the object against the schema and only index the object if it passes. If mustValidate is not set (the default for performance reasons), no validation will happen at the indexing stage.transform callback, it is invoked, see API/tag#Index augmentation for details.Pages are indexed concurrently, so an indexer must never resolve one page’s markup against another page’s index entry: whether that entry exists yet depends on queue order, and two pages could end up disagreeing. Such joins belong at query time instead. At-mentions work this way: the mention records the nickname, and the page claiming it is joined when mentions are read.
Signatures add a second relation kind alongside at-mention: authored. A block-ending -- @name signature emits one authored edge per name it credits, carrying a range into the signature text. An authors: frontmatter declaration emits the same kind with no range, crediting the whole page — the same shape a declared recipients: entry has. A signature also stamps by — the identity ids it credits — onto every at-mention relation inside the block it claims, so a query can join “who wrote this” onto “who it was addressed to” without a second pass.