Describe and index your app content so it is searchable.
- Core Spotlight
The Core Spotlight APIs help you provide a comprehensive description of an item and to add it to the on-device index. They support indexing items at any time, such as when your app loads.
To start indexing app content, perform these steps:
CSSearchableobject and specify properties that describe the item you want to index.
Item Attribute Set
If needed, specify a domain identifier so that you can gather multiple items together and manage them as a group.
Associate the attribute set with the searchable item.
Add the searchable item to the index.
As you use Core Spotlight to make your app content searchable, you can also use
NSUser to make app states and navigation points searchable and to help users return to an activity or app location when they tap on a search result.
Both Core Spotlight and
NSUser use a
CSSearchable object to describe a searchable item, provide rich metadata that is displayed in search results, and prevent duplication of items in search results. Unlike the
NSUser API, however, Core Spotlight APIs don’t require users to visit the content before it gets indexed.
When you use both APIs, you can improve the ranking of your items in search results and prevent item duplication by specifying the same value in
If your app has related content on a website, you should also mark up your website and support universal links to ensure that users can open your native app when they tap a search result supplied by your website (if your app isn’t installed, tapping the result opens Safari).