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

# IndexOptions

> What the Rollup SDK indexes and how.

```swift theme={null}
public struct IndexOptions: Codable, Sendable, Equatable
```

Create one with `IndexOptions()` and set what you want to change. Changing options later changes the index in place: a wider window or a new media type indexes what is missing, a narrower one removes what falls outside. See [Index options](/guides/index-options).

## Properties

<ResponseField name="window" type="Window" default=".growing(from: .months(3))">
  Which capture dates the index holds.
</ResponseField>

<ResponseField name="mediaTypes" type="[MediaType]" default="[.photos, .screenshots, .videos]">
  Which kinds of captures to index.
</ResponseField>

<ResponseField name="focus" type="Focus" default=".everything">
  `.food` indexes only photos of food.
</ResponseField>

<ResponseField name="places" type="Bool" default="true">
  Resolve venues, cuisines and neighborhoods. Sends Rollup's server the 0.01 degree cells photos were taken in. Turning it on or off rebuilds the index.
</ResponseField>

<ResponseField name="screenshotEntities" type="Bool" default="true">
  Read screenshot entities with Apple's on-device model, where Apple Intelligence is available.
</ResponseField>

<ResponseField name="allowsCellular" type="Bool" default="true">
  Allow every download over cellular data, the first-run models included.
</ResponseField>

<ResponseField name="updatesAutomatically" type="Bool" default="true">
  Add new photos on library changes while your app runs, and in background processing runs.
</ResponseField>

<ResponseField name="maxPhotos" type="Int?" default="nil">
  The most photos the index holds. The oldest are removed beyond it.
</ResponseField>

<ResponseField name="backgroundProgress" type="BackgroundProgress" default="BackgroundProgress()">
  The title and subtitle of the system progress UI while indexing continues in the background.
</ResponseField>

## Window

```swift theme={null}
public enum Window: Codable, Sendable, Equatable {
    case growing(from: Span)
    case sliding(Span)
}
```

<ResponseField name="growing(from:)" type="case">
  The first index reaches back `from` the day it is first built, and new photos keep being added. Nothing ages out.
</ResponseField>

<ResponseField name="sliding(_:)" type="case">
  Only the most recent span. Older photos are removed as time passes.
</ResponseField>

Encodes as `{"type":"growing","span":{"unit":"months","value":3}}`.

## Span

```swift theme={null}
public struct Span: Codable, Sendable, Hashable
```

A length of time back from a day. Create one with `.days(_:)`, `.weeks(_:)`, `.months(_:)` or `.years(_:)`, or `Span(_ value: Int, _ unit: Unit)`.

<ResponseField name="unit" type="Unit">
  `.days`, `.weeks`, `.months` or `.years`.
</ResponseField>

<ResponseField name="value" type="Int">
  How many units.
</ResponseField>

<ResponseField name="start(endingOn:calendar:)" type="func -> Date">
  The first day of the span that ends on a given day, at its start of day, in a calendar (`.current` by default).
</ResponseField>

## MediaType

```swift theme={null}
public enum MediaType: String, Codable, Sendable, CaseIterable {
    case photos, screenshots, videos
}
```

## Focus

```swift theme={null}
public enum Focus: String, Codable, Sendable {
    case everything, food
}
```

## BackgroundProgress

```swift theme={null}
public struct BackgroundProgress: Codable, Sendable, Equatable {
    public var title: String
    public var subtitle: String?
    public init(title: String = "Preparing your photos", subtitle: String? = nil)
}
```

The subtitle defaults to the indexing progress when it is `nil`.


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