<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight",
  "metadataVersion" : "0.1.0",
  "role" : "Framework",
  "symbol" : {
    "kind" : "Framework",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "CoreSpotlight"
  },
  "title" : "Core Spotlight"
}
-->

# Core Spotlight

Add search capabilities to your app, and index your content so
people can find it from Spotlight and Safari.

## Overview

Help people access activities and items within your app by adding
details about those items to a Core Spotlight index. The framework provides
APIs to add your content to an index, and search for items in that index. You
decide what content makes sense to index, but typically you index anything
that someone might look for in your app. For example, you might index photos,
contacts, the items someone purchased, or data they see in your interface.
You can then use Core Spotlight to search for your indexed content and display
those results in your app.

> Important: Spotlight File Import extensions don’t provide functionality in macOS. To make custom files available to Spotlight in macOS, create a Spotlight importer plugin. For more information, refer to [Spotlight Importer Programming Guide](https://developer.apple.com/library/archive/documentation/Carbon/Conceptual/MDImporters/MDImporters.html#//apple_ref/doc/uid/TP40001267).

Your app is responsible for indexing your app’s content and maintaining
those indexes. You can index content when your app runs, or provide an app
extension to index content when the system requests it. You can index any
content your app manages, including files and other content that your app
isn’t currently displaying. The indexes you create using Core Spotlight remain
on device, and are private to the owner of the device. Devices don’t share
indexed data with Apple, or synchronize that data with the person’s other devices.

In addition to indexing content, iOS provides additional strategies for
making your app’s content searchable:

- Use the search-related properties of <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> to add items to the on-device index, with the option to identify the items as eligible for public indexing. Learn more about <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> in [Index Activities and Navigation Points](https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/Activities.html#//apple_ref/doc/uid/TP40016308-CH6-SW1).
- Use web markup to index content on your web server in Apple’s server-side index, which makes the data available to all iOS users in Spotlight and Safari search results. For more information, see [Mark Up Web Content](https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/WebContent.html#//apple_ref/doc/uid/TP40016308-CH8-SW1) in [App Search Programming Guide](https://developer.apple.com/library/content/documentation/General/Conceptual/AppSearch/index.html).

## Topics

### Essentials

  <doc://com.apple.documentation/documentation/Updates/CoreSpotlight>

[Adding your app’s content to Spotlight indexes](/documentation/CoreSpotlight/adding-your-app-s-content-to-spotlight-indexes)

Create a description for your app’s content and add it to a Spotlight
index to make it searchable.

### Searchable items

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

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

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

The detailed metadata for a searchable item.

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

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

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

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

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

An object that represents a person in the context of search results.

### Indexes

[Generating summary and priority data for indexed items](/documentation/CoreSpotlight/generating-summary-and-priority-data-for-indexed-items)

Summarize mail, message, and audio transcripts or assess the priority of mail and messages
using Spotlight and Apple Intelligence.

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

An on-device index for your app’s searchable content.

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

A protocol that defines methods a delegate object or app extension uses to handle communication from the on-device index.

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

### Foundation models support

[Spotlight search tool](/documentation/CoreSpotlight/Spotlight-search-tool)

Make your app’s indexed content available to the system’s Foundation models as additional
context to use when answering prompts.

### Spotlight app extensions

[Regenerating your app’s indexes on demand](/documentation/CoreSpotlight/regenerating-your-app-s-indexes-on-demand)

Create an app extension to maintain your app’s indexes and regenerate
them as needed.

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

An interface that implements an index-maintenance app extension.

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

An object that provides searchable attributes for file types that the app supports.

### Queries

[Building a search interface for your app](/documentation/CoreSpotlight/building-a-search-interface-for-your-app)

Add a search interface to your app to execute Spotlight queries
and offer suggested text completions.

[Searching for information in your app](/documentation/CoreSpotlight/searching-for-information-in-your-app)

Search for app-specific content and refine search results using
predicates and filters.

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

A type you use to initiate searches from your interface and
offer suggested text completions.

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

The configuration details to apply to a user query.

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

A type you use to programmatically search the indexed app content.

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

The behavior configuration to use for a search query.

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

The kind of suggestion to use in a query.

### Type resolution

### Errors

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

Index errors returned by Core Spotlight.

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

Search query errors returned by Core Spotlight.

[CSIndex Errors](/documentation/CoreSpotlight/csindex-errors)

Index error codes and error domain.

[CSSearchQuery Errors](/documentation/CoreSpotlight/cssearchquery-errors)

Search query error codes and error domain.

### Version

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

The API version number for Core Spotlight.

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

The project version number for Core Spotlight.

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

The project version string for Core Spotlight.



---

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)