---
title: CSSearchableItem
framework: corespotlight
role: symbol
role_heading: Class
path: corespotlight/cssearchableitem
---

# CSSearchableItem

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

## Declaration

```swift
class CSSearchableItem
```

## Mentioned in

Generating summary and priority data for indexed items Adding your app’s content to Spotlight indexes Making your indexed content available to Foundation Models Searching for information in your app

## Overview

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 object with details about the item. For the metadata, you typically want to provide values for the title, displayName, and contentType attributes at a minimum. If you’re indexing a file on disk, provide a value for the 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 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.

## Topics

### Getting a searchable item

- [init(uniqueIdentifier:domainIdentifier:attributeSet:)](corespotlight/cssearchableitem/init(uniqueidentifier:domainidentifier:attributeset:).md)
- [init(appEntity:)](corespotlight/cssearchableitem/init(appentity:)-3hv5.md)
- [init(appEntity:)](corespotlight/cssearchableitem/init(appentity:)-89ehq.md)
- [init(appEntity:priority:)](corespotlight/cssearchableitem/init(appentity:priority:)-7h9s.md)
- [init(appEntity:priority:)](corespotlight/cssearchableitem/init(appentity:priority:)-7xlow.md)
- [init(coder:)](corespotlight/cssearchableitem/init(coder:).md)

### Setting attributes on a searchable item

- [uniqueIdentifier](corespotlight/cssearchableitem/uniqueidentifier.md)
- [domainIdentifier](corespotlight/cssearchableitem/domainidentifier.md)
- [attributeSet](corespotlight/cssearchableitem/attributeset.md)
- [expirationDate](corespotlight/cssearchableitem/expirationdate.md)
- [isUpdate](corespotlight/cssearchableitem/isupdate.md)
- [updateListenerOptions](corespotlight/cssearchableitem/updatelisteneroptions-swift.property.md)
- [CSSearchableItem.UpdateListenerOptions](corespotlight/cssearchableitem/updatelisteneroptions-swift.struct.md)

### Continuing a search or activity

- [CSSearchableItemActionType](corespotlight/cssearchableitemactiontype.md)
- [CSSearchableItemActivityIdentifier](corespotlight/cssearchableitemactivityidentifier.md)
- [CSQueryContinuationActionType](corespotlight/csquerycontinuationactiontype.md)
- [CSSearchQueryString](corespotlight/cssearchquerystring.md)

### Comparing items

- [compare(byRank:)](corespotlight/cssearchableitem/compare(byrank:).md)

### Associating an entity with an item

- [associateAppEntity(_:priority:)](corespotlight/cssearchableitem/associateappentity(_:priority:)-6h7ym.md)
- [associateAppEntity(_:priority:)](corespotlight/cssearchableitem/associateappentity(_:priority:)-736lx.md)
- [relatedAppEntityIdentifier](corespotlight/cssearchableitem/relatedappentityidentifier.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Searchable items

- [CSSearchableItemAttributeSet](corespotlight/cssearchableitemattributeset.md)
- [CSCustomAttributeKey](corespotlight/cscustomattributekey.md)
- [CSLocalizedString](corespotlight/cslocalizedstring.md)
- [CSPerson](corespotlight/csperson.md)
