---
title: SearchSource
framework: corespotlight
role: symbol
role_heading: Structure
path: corespotlight/searchsource
---

# SearchSource

A source of data for Spotlight to search.

## Declaration

```swift
struct SearchSource
```

## Overview

Overview When configuring the search tool, use this type to specify whether to retrieve data from the app’s Spotlight index or from files at the specified locations. Each of the sources sets the scope of the search, along with other parameters.

## Topics

### Searching a Spotlight index

- [coreSpotlight](corespotlight/searchsource/corespotlight.md)
- [coreSpotlight(_:)](corespotlight/searchsource/corespotlight(_:).md)

### Searching files and directories

- [files](corespotlight/searchsource/files.md)
- [files(_:)](corespotlight/searchsource/files(_:).md)

## Relationships

### Conforms To

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

## See Also

### Data sources

- [CoreSpotlightSource](corespotlight/corespotlightsource.md)
- [FileSource](corespotlight/filesource.md)
- [SearchableItemAttribute](corespotlight/searchableitemattribute.md)
