---
title: maxResultCount
framework: corespotlight
role: symbol
role_heading: Instance Property
path: corespotlight/csuserquerycontext/maxresultcount
---

# maxResultCount

The maximum number of search results for the query to return.

## Declaration

```swift
var maxResultCount: Int { get set }
```

## Discussion

Discussion Spotlight returns all results that it finds by default. Set a maximum limit to terminate the search early, which can improve performance.

## See Also

### Configuring search options

- [maxSuggestionCount](corespotlight/csuserquerycontext/maxsuggestioncount.md)
- [disableSemanticSearch](corespotlight/csuserquerycontext/disablesemanticsearch.md)
