Error CSIndexErrorDomain -1005

I get this error "The operation couldn't be completed. (CSIndexErrorDomain error -1005.)" When I run the code to search for the spotlight on the ipad. Does anyone know how to solve this error?

+6
source share
2 answers

CoreSpotlight is available on iOS 9 onwards.

Although your device may be on iOS 9.x, it may still not work if it is an older version of the device.

From Apple docs.

Although app search is available for iOS 9 users, NSUserActivity and Core Spotlight search features are not supported on iPhone 4, iPad 2, iPad (3rd generation), iPad mini, and iPod touch (5th generation).

So, if you test on any of the above devices or simulators, you will get CSIndexErrorDomain error -1005.

From Corespotlight API documentation

CSIndexErrorCodeIndexingUnsupported = -1005, // Indexing is not supported on this device

+22
source

Since the search function is not available on all devices that support iOS9, check the following condition to find out if the device supports search

 if ([CSSearchableIndex isIndexingAvailable]) 

and save your search methods in this condition.

+10
source

All Articles