<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/SearchPipelineData",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Spotlight",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:31_CoreSpotlight_FoundationModels18SearchPipelineDataV"
  },
  "title" : "SearchPipelineData"
}
-->

# SearchPipelineData

The type you use to store the output from a custom stage.

```
struct SearchPipelineData
```

## Overview

A custom stage receives data as input and generate a `SearchPipelineData` structure as output. When generating
output for a stage in your `execute` methods, build the output data and wrap it with this structure before returning it.
This type manages the handoff of your output data to the next stage in the pipeline or to the model.

## Topics

### Configuring the pipeline data

[`init(payload: SearchPipelineData.Payload)`](/documentation/CoreSpotlight/SearchPipelineData/init(payload:))

Initializes the pipeline data with the specified payload value.

[`static func items([SearchableItem]) -> SearchPipelineData`](/documentation/CoreSpotlight/SearchPipelineData/items(_:))

Creates a pipeline data structure from the an array of searchable items.

[`static func scoredItems([ScoredSearchableItem]) -> SearchPipelineData`](/documentation/CoreSpotlight/SearchPipelineData/scoredItems(_:))

Creates a pipeline data structure from the an array of scored searchable items.

[`static func groupedItems([SearchableItemAttribute : [SearchableItem]]) -> SearchPipelineData`](/documentation/CoreSpotlight/SearchPipelineData/groupedItems(_:))

Creates a pipeline data structure from a dictionary of attributes and searchable items.

[`static func text(String) -> SearchPipelineData`](/documentation/CoreSpotlight/SearchPipelineData/text(_:))

Creates a pipeline data structure from a text string.

[`static func count(Int) -> SearchPipelineData`](/documentation/CoreSpotlight/SearchPipelineData/count(_:))

Creates a pipeline data structure from an integer value.

[`static func statistic(name: String, value: Double) -> SearchPipelineData`](/documentation/CoreSpotlight/SearchPipelineData/statistic(name:value:))

Creates a pipeline data structure from statistical information.

[`static func table(SearchResultsTable) -> SearchPipelineData`](/documentation/CoreSpotlight/SearchPipelineData/table(_:))

Creates a pipeline data structure from tabular data.

### Getting the pipeline data

[`let payload: SearchPipelineData.Payload`](/documentation/CoreSpotlight/SearchPipelineData/payload-swift.property)

The output data your custom stage produced.

[`enum Payload`](/documentation/CoreSpotlight/SearchPipelineData/Payload-swift.enum)

The typed variants of data a pipeline stage can produce.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)