<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSUserQueryContext/maxRankedResultCount",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "c:objc(cs)CSUserQueryContext(py)maxRankedResultCount"
  },
  "title" : "maxRankedResultCount"
}
-->

# maxRankedResultCount

The maximum number of ranked results to return during the query.

```
var maxRankedResultCount: Int { get set }
```

## Discussion

Spotlight ranks a limited number of results by default, but you can
change the default value to improve performance or better suit your
app’s interface. For example, you might want to return only the five
most relevant results due to space constraints in your UI.

---

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)