<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSSearchQueryError",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Spotlight"
    ],
    "preciseIdentifier" : "s:SC22CSSearchQueryErrorCodeLeV"
  },
  "title" : "CSSearchQueryError"
}
-->

# CSSearchQueryError

Search query errors returned by Core Spotlight.

```
struct CSSearchQueryError
```

## Topics

### Getting the error codes

[`cancelled`](/documentation/CoreSpotlight/CSSearchQueryError/cancelled)

The query stopped because someone canceled it.

[`indexUnreachable`](/documentation/CoreSpotlight/CSSearchQueryError/indexUnreachable)

The index is unreachable.

[`invalidQuery`](/documentation/CoreSpotlight/CSSearchQueryError/invalidQuery)

The query is syntactically invalid or specifies items that your app
doesn’t have access to.

[`unknown`](/documentation/CoreSpotlight/CSSearchQueryError/unknown)

An unknown error occurred.

### Getting codes for query-related errors

[`CSSearchQueryError.Code`](/documentation/CoreSpotlight/CSSearchQueryError/Code)

Error codes that describe reasons a query might fail.

### Getting the error description

[`errorDomain`](/documentation/CoreSpotlight/CSSearchQueryError/errorDomain)



---

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)