> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryrollup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Index options

> Choose which photos the Rollup SDK indexes and what it derives from them.

Pass `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.

```swift theme={null}
var options = IndexOptions()
options.window = .growing(from: .months(6))
options.mediaTypes = [.photos, .screenshots]
options.allowsCellular = false

try Rollup.configure(publishableKey: "rk_live_...", indexing: options)
```

## Options

| Option | Default | What it does |
| - | - | - |
| `window` | `.growing(from: .months(3))` | Which capture dates the index holds. See [Time window](#time-window). |
| `mediaTypes` | `[.photos, .screenshots, .videos]` | Which kinds of captures to index. Videos are indexed from a still frame. Screen recordings are never indexed, even with `.videos`. |
| `focus` | `.everything` | `.food` indexes only photos of food. |
| `places` | `true` | Resolve the venues, cuisines and neighborhoods of the places photos were taken. |
| `screenshotEntities` | `true` | Read entities from screenshots with Apple's on-device model, where Apple Intelligence is available. |
| `allowsCellular` | `true` | Allow downloads over cellular data, including the first-run models. |
| `updatesAutomatically` | `true` | Add new photos as they reach the library, while your app runs and in background runs. |
| `maxPhotos` | `nil` | The most photos the index holds. The oldest are removed beyond it. |
| `backgroundProgress` | "Preparing your photos" | The title, and optionally the subtitle, of the system progress UI while indexing continues in the background. The subtitle defaults to the indexing progress. |

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)`.

<Tabs>
  <Tab title="Growing">
    `.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.
  </Tab>

  <Tab title="Sliding">
    `.sliding(.months(3))` holds only the most recent three months. As time passes, photos older than that are removed.
  </Tab>
</Tabs>

## Changing options

A change applies to the existing index in place. The SDK does not rebuild the index, except when you turn `places` 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 **`maxPhotos`** removes the photos that fall outside.
* **Turning `focus` to `.food`** removes indexed photos that are not food. **Turning it back to `.everything`** indexes the photos it left out.
* **Turning `places` on or off** rebuilds the index.

```swift theme={null}
Rollup.shared.indexing.options.window = .growing(from: .years(1))
```

The change takes effect on the next indexing run, which starts shortly.

<Note>
  Removing photos needs full Photos access. With limited access, the SDK adds photos but does not remove them when you narrow the selection.
</Note>

## Places

With `places` 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.

<Warning>
  To download place data, the SDK sends Rollup's server the grid cells, 0.01 degrees on a side (about 1 km), that the person's photos were taken in. The server can see which areas those are. Mention this in your privacy disclosures, or turn `places` off.
</Warning>

Without places, search still reads dates, cities and countries from an offline geography on the device, and everything a photo shows or says. Venue names, cuisines and venue categories are not available.

## 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

With `allowsCellular` set to `false`, every download waits for Wi-Fi, including the about 225 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.