Class

CSSearchableItem

An item that can be indexed and made available to users when they search on their devices.

Declaration

@interface CSSearchableItem : NSObject

Overview

To make content searchable, create an attribute set that contains properties that specify the metadata you want to display about an item in a search result. Typically, you want to set at least the following attributes: title, contentDescription, thumbnailData, rating, and keywords. For more information, see initWithItemContentType:.

Next, call initWithUniqueIdentifier:domainIdentifier:attributeSet: to create a searchable item related to your attribute set. Then add the item to the index by using indexSearchableItems:completionHandler:. If you need to delete items from the index, use the appropriate CSSearchableIndex method, such as deleteSearchableItemsWithIdentifiers:completionHandler:.

Topics

Getting a Searchable Item

- initWithUniqueIdentifier:domainIdentifier:attributeSet:

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

Setting Attributes on a Searchable Item

attributeSet

The set of attributes that contain metadata associated with the item in a CSSearchableItemAttributeSet object.

domainIdentifier

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

expirationDate

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

uniqueIdentifier

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

Continuing a Search or Activity

CSSearchableItemActionType

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

CSSearchableItemActivityIdentifier

Provides the key within the NSUserActivity object’s userInfo dictionary for which the value is the searchable item’s unique identifier .

CSQueryContinuationActionType

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

CSSearchQueryString

Provides the key within the NSUserActivity object’s userInfo dictionary for which the value is the string that represents the user’s current query.

Relationships

Inherits From

See Also

First Steps

Making Content Searchable

Describe and index your app content so it is searchable.