<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/FileSource/fetchAttributes",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Spotlight",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:31_CoreSpotlight_FoundationModels10FileSourceV15fetchAttributesSay0aB023SearchableItemAttributeVGvp"
  },
  "title" : "fetchAttributes"
}
-->

# fetchAttributes

The attributes to fetch for each file or directory and provide to the model.

```
var fetchAttributes: [SearchableItemAttribute]
```

## Discussion

Use this property to minimize the number of round trips between the Spotlight search tool and
your content. When you index your app’s content, you create a [`CSSearchableItemAttributeSet`](/documentation/CoreSpotlight/CSSearchableItemAttributeSet)
for each item and fill it with metadata about that item. For example, you might specify the
title of a document and the number of pages it contains. For each item the Spotlight search
tool identifies as a result, the tool retrieves the attributes you specify in this property.
The tool delivers these attributes together with the item’s identifier to the model so it
doesn’t have to request them later.

The default value of this property is an empty set, which delivers only the item’s identifier to the model.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)