---
title: CoreSpotlightSource
framework: corespotlight
role: symbol
role_heading: Structure
path: corespotlight/corespotlightsource
---

# CoreSpotlightSource

A search source that retrieves data from the app’s Spotlight index.

## Declaration

```swift
struct CoreSpotlightSource
```

## Mentioned in

Making your indexed content available to Foundation Models

## Overview

Overview Use this type to configure the Spotlight search tool to search your app’s indexed content. When performing searches, the tool queries your content for CSSearchableItem objects that match the specified criteria. When delivering search results to the model, the tool delivers each item’s identifier and any attributes you specify in the fetchAttributes property. To provide additional item-specific content that isn’t in the Spotlight index, provide a delegate object to generate that data dynamically from your content. This type is @unchecked Sendable because CSSearchableIndexDelegate is a non-Sendable ObjC protocol. If you provide a delegate object, you must ensure that object is safe to use across isolation boundaries.

## Topics

### Creating a Spotlight source

- [init(fetchAttributes:)](corespotlight/corespotlightsource/init(fetchattributes:).md)
- [init(searchableIndexDelegate:fetchAttributes:)](corespotlight/corespotlightsource/init(searchableindexdelegate:fetchattributes:).md)

### Configuring the search options

- [fetchAttributes](corespotlight/corespotlightsource/fetchattributes.md)
- [sourceOptions](corespotlight/corespotlightsource/sourceoptions.md)
- [maximumResultCount](corespotlight/corespotlightsource/maximumresultcount.md)

### Providing additional attributes

- [searchableIndexDelegate](corespotlight/corespotlightsource/searchableindexdelegate.md)
- [CSSearchableIndexDelegate](corespotlight/cssearchableindexdelegate.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Data sources

- [SearchSource](corespotlight/searchsource.md)
- [FileSource](corespotlight/filesource.md)
- [SearchableItemAttribute](corespotlight/searchableitemattribute.md)
