---
title: CSUserQueryContext
framework: corespotlight
role: symbol
role_heading: Class
path: corespotlight/csuserquerycontext
---

# CSUserQueryContext

The configuration details to apply to a user query.

## Declaration

```swift
class CSUserQueryContext
```

## Mentioned in

Building a search interface for your app

## Overview

Overview Use an instance of CSUserQueryContext to configure the search parameters for a CSUserQuery object. This object stores configuration details that the query uses to modify the search results it delivers. For example, use this object to specify the maximum number of results or suggestions you want the query to return. You can also use it to enable or disable the ranking of results by Spotlight. For information about search filters and other configurable query parameters, see the parent class CSSearchQueryContext.

## Topics

### Creating a query context

- [init(currentSuggestion:)](corespotlight/csuserquerycontext/init(currentsuggestion:).md)

### Configuring search options

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

### Configuring the ranked results behavior

- [enableRankedResults](corespotlight/csuserquerycontext/enablerankedresults.md)
- [maxRankedResultCount](corespotlight/csuserquerycontext/maxrankedresultcount.md)

## Relationships

### Inherits From

- [CSSearchQueryContext](corespotlight/cssearchquerycontext.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Queries

- [Building a search interface for your app](corespotlight/building-a-search-interface-for-your-app.md)
- [Searching for information in your app](corespotlight/searching-for-information-in-your-app.md)
- [CSUserQuery](corespotlight/csuserquery.md)
- [CSSearchQuery](corespotlight/cssearchquery.md)
- [CSSearchQueryContext](corespotlight/cssearchquerycontext.md)
- [CSSuggestion](corespotlight/cssuggestion.md)
