Framework

Core Spotlight

Index your app so users can search the content from Spotlight and Safari.

Overview

You can help users access activities and items within your app by making your content searchable. The Core Spotlight framework provides APIs to label and manage persistent user data like photos, contacts, and purchased items in the on-device index, and allows you to create links into your app.

The Core Spotlight APIs do not make items publicly searchable. Instead, Core Spotlight enables you to make items searchable in the user's private, on-device index, the contents of which is never shared with Apple or synced between devices.

iOS provides additional strategies for making your app's content searchable:

Core Spotlight enables you to index content at any point, such as when the app loads, and the Core Spotlight APIs do not require users to visit the content in order to index it. Core Spotlight works best when you have no more than a few thousand items.

Topics

First Steps

Making Content Searchable

Describe and index your app content so it is searchable.

class CSSearchableItem

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

Items

class CSSearchableItemAttributeSet

The set of properties to display for a searchable item.

class CSCustomAttributeKey

A key associated with a custom attribute for a searchable item.

Indexes

class CSSearchableIndex

The on-device index.

class CSIndexExtensionRequestHandler

An interface that implements an index-maintenance app extension.

Queries

class CSSearchQuery

The criteria to apply when searching previously indexed app content.

class CSLocalizedString

An object displaying localized text in search results related to your app.

class CSPerson

An object representing a person in the context of search results.

Errors

struct CSIndexError

Index errors returned by Core Spotlight.

CSIndex Errors

Index error codes and error domain.

struct CSSearchQueryError

Search query errors returned by Core Spotlight.

CSSearchQuery Errors

Search query error codes and error domain.