<!--
{
  "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/SearchStatistic",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Spotlight",
      "FoundationModels"
    ],
    "preciseIdentifier" : "s:31_CoreSpotlight_FoundationModels15SearchStatisticV"
  },
  "title" : "SearchStatistic"
}
-->

# SearchStatistic

A scalar statistic derived from search results (sum, average, max, min, median, stddev).

```
struct SearchStatistic
```

## Topics

### Creating a search statistic

[`init(name: String, value: Double, header: String?)`](/documentation/CoreSpotlight/SearchStatistic/init(name:value:header:))

### Getting the statistic details

[`let name: String`](/documentation/CoreSpotlight/SearchStatistic/name)

The statistic name (e.g., “average”, “max”, “total”).

[`let header: String?`](/documentation/CoreSpotlight/SearchStatistic/header)

A short description of what was computed (e.g., “Average file size”).

[`let value: Double`](/documentation/CoreSpotlight/SearchStatistic/value)

The computed value.

## 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)