Skip to main content

Module record_index

Module record_index 

Source
Expand description

An app’s records read without its window: what the system’s search index asks of an app that has not opened the record.

Search is a record’s to answer, not a window’s: a message, a conversation or an agent is found on a device that never ran the app, because whoever keeps the record reads it here and publishes what it holds to the same index a running window publishes to. The reader is the app’s own binary in its --index mode: it links the app’s model types, so what it derives is exactly what the app’s window would, and the session that asks links none of them (docs/architecture/apps.md).

The document arrives on standard input and leaves as the entries on standard output, as JSON: no path, no store and no window is handed in, so a reader cannot reach anything but the bytes it was asked about.

Constants§

INDEX_FLAG
The flag that makes an app’s binary print what a record holds for search instead of running: its document is read from standard input.

Functions§

entries
What search finds in doc, as the index keeps it: every kind of A’s that the document holds, read the way its window reads the record.
serve
Answer the --index mode when the command line asks for it: read the record’s document from standard input and print its entries. None for a command line that starts the app as usual.