<!--
{
  "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/statistic(name:value:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Spotlight",
      "FoundationModels",
      "_CoreSpotlight_FoundationModels"
    ],
    "preciseIdentifier" : "s:31_CoreSpotlight_FoundationModels18SearchPipelineDataV9statistic4name5valueACSS_SdtFZ"
  },
  "title" : "statistic(name:value:)"
}
-->

# statistic(name:value:)

Creates a pipeline data structure from statistical information.

```
static func statistic(name: String, value: Double) -> SearchPipelineData
```

## Parameters

`name`

The name of the statistic your stage produced. Specify strings like “average”, “max”, “min”, “sum”, “median”, or “stddev”.

`value`

The statistical value you generated.

---

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)