Smart Index
Keeps Smart Search's index current, in the background, with nothing for the user to do:
Backlog (everything not indexed yet) runs only while charging and the battery isn't low, so a first index of thousands of photos and videos never costs battery; unless the user turns on Index on Battery (Settings → Smart Search), which drops the charger rule.
New items: MediaStore wakes Lumen shortly after a photo or video is added; up to NewLimit get indexed right away, charging or not. More than that waits for the charger.
Scheduled Indexing (Settings): the backlog runs only in the user's hours (overnight, say), plugged in or not; a small job wakes Lumen at the window's start and end. Both resume where they stopped. Scheduled at app start and when a model finishes downloading.
Types
Properties
The same for finding faces (FaceIndexer).
Latest counts from a pass (null until one runs in this process).
The same for reading text in photos (TextIndexer).
Functions
Makes sure both jobs are queued, if a search, text or face model is installed. Safe to call often (app start). A backlog job waiting out a back-off is replaced by a fresh one, so opening Lumen restarts a stalled index; a running one is left alone.