IndexOptions to configure, or change them later through Rollup.shared.indexing.options. Every option has a default, so you only set what you want to change.
Options
Hidden photos are never indexed. With limited Photos access, the SDK indexes only the photos the person selected.
Time window
The window decides which capture dates the index holds. Spans can be days, weeks, months or years:.days(30), .weeks(8), .months(3), .years(1).
- Growing
- Sliding
.growing(from: .months(3)) reaches back three months from the day the index was first built, and keeps adding new photos from then on. Nothing ages out, so the index grows with the library.Changing options
A change applies to the existing index in place. The SDK does not rebuild the index, except when you turnplaces, events or people on or off.
- Widening the window or adding a media type indexes the photos that are now missing.
- Narrowing the window, removing a media type, a sliding window passing a photo, or reaching
maxPhotosremoves the photos that fall outside. - Turning
focusto.foodremoves indexed photos that are not food. Turning it back to.everythingindexes the photos it left out. - Turning
places,eventsorpeopleon or off rebuilds the index.
Removing photos needs full Photos access. With limited access, the SDK adds photos but does not remove them when you narrow the selection.
Places
Withplaces on, the SDK resolves where photos were taken: the venue of each visit (a restaurant, a museum, a stadium), its cuisine for food visits, and the neighborhood and city. To do this it downloads place data from Rollup’s server for the areas the photos fall in.
Without places, indexing sends no location. Search still reads dates and everything a photo shows or says, and places each photo in its country and the nearest city of 15,000 people or more (within 75 km) from geography on the device. Venue names, cuisines, venue categories and neighborhoods are not available.
Events
Withevents on, the SDK also looks up the event a visit was at: the concert, festival, game or race (a tennis tournament, a horse race, a marathon, a NASCAR race or a Formula 1 weekend) at a venue near the visit while the person was there. Search finds the visit’s photos by the event’s name, each result carries it in event, and query and profile can use it (“Which games did I go to this year?”).
The SDK looks up only visits that look like an event: photos that look like a crowd, a stage or a stadium, or a stadium, arena or concert venue nearby. It keeps an event only when the photos support it, so a walk past an arena on a game night does not count.
Food focus
focus = .food indexes only food photos, as Apple’s on-device food detection finds them. Screenshots are not indexed in this mode. On one library this was about one photo in ten, so indexing is much faster, but search, query and profile only know about food.
Cellular data
WithallowsCellular set to false, every download waits for Wi-Fi, including the about 165 MB of models on first run. iCloud Photos follows the person’s own Photos settings when the SDK needs a photo that is not on the iPhone.