<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(cs)CSSearchableItem"
  },
  "title" : "CSSearchableItem"
}
-->

# CSSearchableItem

The details of your app-specific content that someone might search
for on their devices.

```
class CSSearchableItem
```

## Overview

A `CSSearchableItem` uniquely identifies a part of your app’s
content, and provides the metadata that Spotlight indexes and uses
to find that content later. As part of indexing your app’s content,
you create searchable items and fill them with details about your
app’s content and where to find it. After indexing the content, you
can then execute queries using the Core Spotlight APIs to find the
items you indexed. People can also use the system’s Spotlight search
interface to find your app’s content.

When you create or update content in your app, create a `CSSearchableItem`
for that content if you want it to be searchable. A searchable item
contains identification strings you use to locate that item in your
content and a [`CSSearchableItemAttributeSet`](/documentation/CoreSpotlight/CSSearchableItemAttributeSet) object with details about
the item. For the metadata, you typically want to provide values for
the [`title`](/documentation/CoreSpotlight/CSSearchableItemAttributeSet/title), [`displayName`](/documentation/CoreSpotlight/CSSearchableItemAttributeSet/displayName),
and [`contentType`](/documentation/CoreSpotlight/CSSearchableItemAttributeSet/contentType) attributes at a minimum.
If you’re indexing a file on disk, provide a value for the [`contentURL`](/documentation/CoreSpotlight/CSSearchableItemAttributeSet/contentURL)
attribute. Fill in as many other attributes as makes sense for the content
you’re indexing.

After creating a searchable item, index it using a [`CSSearchableIndex`](/documentation/CoreSpotlight/CSSearchableIndex)
object. As you update your app’s content, update your `CSSearchableItem`
objects for that content and index them right away. If you delete content,
similarly delete the searchable items from the index. Keeping your app’s
indexes current ensures that searches return valid information. For more
information on indexing your content, see [Adding your app’s content to Spotlight indexes](/documentation/CoreSpotlight/adding-your-app-s-content-to-spotlight-indexes).

## Topics

### Getting a searchable item

[`-  initWithUniqueIdentifier:domainIdentifier:attributeSet:`](/documentation/CoreSpotlight/CSSearchableItem/init(uniqueIdentifier:domainIdentifier:attributeSet:))

Returns a searchable item associated with the specified identifier, domain identifier, and attribute set.

[`init(appEntity:)`](/documentation/CoreSpotlight/CSSearchableItem/init(appEntity:)-3hv5)

Initializes a new searchable item with the relevant fields populated from the provided app entity.
Resolves deferred properties before indexing.

[`init(appEntity:)`](/documentation/CoreSpotlight/CSSearchableItem/init(appEntity:)-89ehq)

Initializes a new searchable item with the relevant fields populated from the provided app entity.

[`init(appEntity:priority:)`](/documentation/CoreSpotlight/CSSearchableItem/init(appEntity:priority:)-7h9s)

Initializes a new searchable item with the relevant fields populated from the provided app entity.

[`init(appEntity:priority:)`](/documentation/CoreSpotlight/CSSearchableItem/init(appEntity:priority:)-7xlow)

Initializes a new searchable item with the relevant fields populated from the provided app entity.
Resolves deferred properties before indexing.

[`init(coder:)`](/documentation/CoreSpotlight/CSSearchableItem/init(coder:))

### Setting attributes on a searchable item

[`uniqueIdentifier`](/documentation/CoreSpotlight/CSSearchableItem/uniqueIdentifier)

The value that uniquely identifies the searchable item within your app.

[`domainIdentifier`](/documentation/CoreSpotlight/CSSearchableItem/domainIdentifier)

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

[`attributeSet`](/documentation/CoreSpotlight/CSSearchableItem/attributeSet)

The set of attributes that contain metadata associated with the item in a [`CSSearchableItemAttributeSet`](/documentation/CoreSpotlight/CSSearchableItemAttributeSet) object.

[`expirationDate`](/documentation/CoreSpotlight/CSSearchableItem/expirationDate)

The date after which the searchable item should no longer exist.

[`isUpdate`](/documentation/CoreSpotlight/CSSearchableItem/isUpdate)

A Boolean value that indicates whether to treat the item as an
update instead of a new item.

[`updateListenerOptions`](/documentation/CoreSpotlight/CSSearchableItem/updateListenerOptions-swift.property)

The types of notifications to request from Spotlight.

[`UpdateListenerOptions`](/documentation/CoreSpotlight/CSSearchableItem/UpdateListenerOptions-swift.struct)

The options to generate summarization or prioritization information for a searchable item.

### Continuing a search or activity

[`CSSearchableItemActionType`](/documentation/CoreSpotlight/CSSearchableItemActionType)

Indicates that the activity type to continue is related to a searchable item.

[`CSSearchableItemActivityIdentifier`](/documentation/CoreSpotlight/CSSearchableItemActivityIdentifier)

The key you use to access a searchable item in a user activity object.

[`CSQueryContinuationActionType`](/documentation/CoreSpotlight/CSQueryContinuationActionType)

Indicates that the activity type to continue is a search or query.

[`CSSearchQueryString`](/documentation/CoreSpotlight/CSSearchQueryString)

Provides the key for the current query in the info dictionary of the user activity object.

### Comparing items

[`-  compareByRank:`](/documentation/CoreSpotlight/CSSearchableItem/compare(byRank:))

Compares two items by rank and returns the result.

### Associating an entity with an item

[`associateAppEntity(_:priority:)`](/documentation/CoreSpotlight/CSSearchableItem/associateAppEntity(_:priority:)-6h7ym)

Associates an app entity with this searchable item. Resolves deferred properties before association.

[`associateAppEntity(_:priority:)`](/documentation/CoreSpotlight/CSSearchableItem/associateAppEntity(_:priority:)-736lx)

Associates an app entity with this searchable item.

[`relatedAppEntityIdentifier`](/documentation/CoreSpotlight/CSSearchableItem/relatedAppEntityIdentifier)

The identifier of the related indexed entity for this searchable item.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)