Skip to main content
What Rollup.shared.search(_:limit:offset:) returns: a page of results in order with what the index holds about each, how many there were, the query as search read it, and how long it took.
String
The search as asked.
[SearchResult]
The results, most relevant first: limit of them (500 by default) from offset.
Int
How many results the search found, before limit and offset. More than results.count when results were cut.
SearchPlan
How search read the query.
Double
Seconds for the whole search.
[String: Double]
Seconds for its parts, by name, such as locationResolution, filtering, embedding and text.
JSONValue?
What the index covers: counts, dates and media.

SearchPlan

String
semantic_search, location_search, date_search, capture_search or holiday_search.
String
content, place, content_and_place, place_type, holiday or metadata.
String
What was left to match images and text against once dates, media and places were read.
String
most_relevant or newest_first.
JSONValue
The whole plan: the date, capture, location and place filters search applied, with its policies and counts.

SearchResult

One asset and what the index holds about it.
String
The asset’s PhotoKit local identifier.
Date?
When it was taken.
TimeZone?
The time zone where it was taken.
MediaType
.photo, .video or .screenshot.
Bool
Whether the person marked it as a favorite.
Location?
Where it was taken, as the on-device geography placed it.
[Label]
What it shows, most confident first.
[Place]
The venue its visit resolved to. Empty when places is off or no venue was resolved.
[String]
Cuisines of its visit, on food photos.
String?
The text search matches against: sign text, text read from the preview, or a screenshot’s text.
Screenshot?
What was read from a screenshot.
[String]
Kinds of sensitive content the photo, video or screenshot holds, decided on the iPhone. Empty when none. See Sensitive photos.
Event?
The event its visit was at, when events is on and one was found: its type (concert, festival, sports, theater, comedy, conference or other), title, venue, start and end, confidence (0 to 1), genres: the listing’s music genres (indie, hip-hop-rap), headliners’ first, and lineup: everyone on the bill, headliners first. Both are empty for games. A benefit or multi-artist show keeps its own title when the listing has one (“FireAid Benefit Concert”).
[Activity]
Every activity its visit shows, strongest first, on Rollup’s activity taxonomy. Empty when none fits.
Context?
The circumstances of its visit. Nil without a visit.
[String]
The people whose faces are in it (Person.id). Empty with people off.
String?
Deprecated: use activities. Its visit’s activity, decided on the device from the visit’s own venue, time and photos, whether events is on or not: Brunch, Hike, Nightclub, Museum/Art, Sports/Rec League, Game Night, Film Screening, Ski and the like. Nil when none fits. A visit’s event decides it where there is one: a concert is Live Music/Concert, a festival Festival, a conference Networking and a game or tournament Sports Game.
Double?
The relevance model’s probability, for image matches.
String?
The words of the asset’s text that hold the query, for text matches.
Double?
Search’s score for this result.
Double?
The retrieval score before ranking.
Double?
How closely its place matched a place in the query.
[String]
Why it matched, such as image, text or place.
JSONValue?
The named places the result matched.
[String]
The PhotoKit local identifiers of other photos of the same shot. Search shows them once, as this result. Empty when there are none.

Sensitive photos

sensitivity can hold personal_data (an ID card, passport or driver’s license), health (a prescription or a medical record), nudity (it can also mark swimwear or nude art) and, for screenshots, financial_information (payment details) and authentication (passwords and codes). It is an estimate and can be wrong. query, facets, indexing batches, people() and photos(of:) leave out every asset with one of these kinds. search still returns them, flagged, so your app can drop them before anything leaves the iPhone.

Activity

String
The activity’s stable id, such as sports.racket.tennis.
String
[String]
Names from the top of the taxonomy down.
Double
How reliable this kind of evidence is, from 0 to 1.
String
What it came from: lookup (a matched event), rules, venue, photos, cuisine, travel or fallback.

Context

Bool
Far from the places the person usually takes photos.
Bool
People appear in the visit’s photos.
String
morning, afternoon, evening or late night.
Bool
Bool
A photo of the visit is a selfie.

Location

String?
String?
String?
String?
String?
Double?
Double?
String
The neighborhood, city and country that are known, joined with commas.

Label

String
The label’s concept ID.
String
The label, such as sushi or dog.
Double?
How confident Rollup is in the label, from 0 to 1.
Double?
The image model’s cosine similarity, for labels without a probability.

Place

String
The venue’s name.
String?
The venue’s category.
Double
How confident the place resolution is.

Screenshot

String
The kind of app the screenshot was taken in.
String
What the screenshot is about.
String
What the person was doing.
[String: Double]
Each field’s top probability, by field: app_kind, topic and action.
[String]
Kinds of sensitive content the screenshot holds. The result’s own sensitivity has the same kinds.
String?
A date it shows, as YYYY-MM-DD or --MM-DD, with THH:MM when a time was shown.
String
How the shown date relates to when the screenshot was taken.
[Entity]
Entities Apple’s on-device model read, each with an id, a type and a value.
String
Whether entities were read, and if not, why. deferred: indexed while the app was off screen; read on the next run on screen.