<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSSearchableItem/domainIdentifier",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(cs)CSSearchableItem(py)domainIdentifier"
  },
  "title" : "domainIdentifier"
}
-->

# domainIdentifier

An optional identifier that represents the domain or owner of the item.

```
var domainIdentifier: String? { get set }
```

## Discussion

Specify a domain identifier to group items together and to make it easy to delete groups of items from the index. For example, you might specify an identifier for a mailbox in an account whose indexed data you want to remove when the account is deleted. In this example, [`domainIdentifier`](/documentation/CoreSpotlight/CSSearchableItem/domainIdentifier) should be of the form `<account-id>.<mailbox-id>`, where neither `<account-id>` nor `<mailbox-id>` contain periods. To delete all items associated with the specified account and mailbox, you can call [`deleteSearchableItems(withDomainIdentifiers:completionHandler:)`](/documentation/CoreSpotlight/CSSearchableIndex/deleteSearchableItems(withDomainIdentifiers:completionHandler:)) with a [`domainIdentifier`](/documentation/CoreSpotlight/CSSearchableItem/domainIdentifier) of `<account-id>.<mailbox-id>`. Or to delete all items associated with all mailboxes in the specified account, you can call [`deleteSearchableItems(withDomainIdentifiers:completionHandler:)`](/documentation/CoreSpotlight/CSSearchableIndex/deleteSearchableItems(withDomainIdentifiers:completionHandler:)) with a [`domainIdentifier`](/documentation/CoreSpotlight/CSSearchableItem/domainIdentifier) of `<account-id>`.

---

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)