<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSImportExtension/update(_:forFileAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(cs)CSImportExtension(im)updateAttributes:forFileAtURL:error:"
  },
  "title" : "update(_:forFileAt:)"
}
-->

# update(_:forFileAt:)

Provides searchable attributes for a file at the specified URL.

```
func update(_ attributes: CSSearchableItemAttributeSet, forFileAt contentURL: URL) throws
```

## Parameters

`attributes`

The attribute set for the file at `contentURL`.

`contentURL`

The URL of the file to provide attributes for.

## Discussion

When Core Spotlight invokes this method, update the properties of the attribute set according to the content in the specified file. For a complete list of properties available, see [`CSSearchableItemAttributeSet`](/documentation/CoreSpotlight/CSSearchableItemAttributeSet).

> Important:
> Core Spotlight indexes files in batches and may call this method simultaneously on multiple queues with different values of `contentURL`.

---

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)