Skip to main content
Use these to show the library while it is indexed, without searching again and again. A sorting screen can call facets once, then add each batch’s photos to its groups as they arrive.
Call facets again when the state is ready to get the final groups.

IndexedBatch

What Rollup.shared.indexing.batches reports each time part of a run becomes searchable, about a hundred photos at a time. The stream starts from now: photos indexed earlier are in search and facets.
[IndexedItem]
The photos that just became searchable, newest first.
Int
Photos done in the whole index once this batch is in.
Int
Photos the index’s options take, as IndexingProgress.total.
A shot’s near-duplicates come once, and sensitive photos and screenshots (see sensitivity) are left out. A part with nothing to show sends no batch.

IndexedItem

String
The PhotoKit local identifier.
String
photo, screenshot or video.
Date?
When it was taken.
[SearchResult.Label]
What it shows, most confident first, as in search results.

Facet

One of the index’s largest groups, from Rollup.shared.facets(limit:samples:). Groups on most of the library, or on very few photos, are left out.
String
Stable across calls, such as label:oewn:i51129, place:fsq:park, cuisine:ramen or food.
String
A name to show.
String
label, place, cuisine or food.
Int
Photos in the group: a shot once, sensitive photos and screenshots not at all.
[String]
A few of its photos’ PhotoKit identifiers, newest first.

JSON