Not able to find the indexed data in spotlight

Hi All,

I am using the CoreSpotLight api to index some content. For some reason I am not able to find the data when I search in the

SpotLight.


let atset:CSSearchableItemAttributeSet = CSSearchableItemAttributeSet()
atset.title = "Simple title"
atset.contentDescription = "Simple twitter search"
let item = CSSearchableItem(uniqueIdentifier: "id1", domainIdentifier: "com.shrikar.twitter.search", attributeSet: atset)
CSSearchableIndex.defaultSearchableIndex().indexSearchableItems([item]) { (error) -> Void in
     print("Indexed")
}


When I run the app I see that the data is indexed and the error is nil.

Also I have added the CoreSpotLight and MobileCoreServices to the build phase.

I'm having the same issue. Items index without an error, but nothing gets returned in spotlight when I search for any indexed search term. Also, my app doesn't show up in the list of search providers in Settings (not sure if that is intended or not).


Is there anything else we need to do to turn this on? I've also implemented the application:continueUserActivity:restorationHandler method in the app delegate.

I had this problem until I tried the predefined type they showed in the talk. Once I changed it over to initWithItemContentType and used kUTTypeImage it started working (mostly...) I still can't get it to show the thumbnail image but it does show up in the spotlight list. Hopefully beta 2 resolves this.

Ok looks like the issue was with the CSSearchableItemAttributeSet if you dont pass the contentType like kUTTypeImage or kUTTypeText I was not able to index the data.. Also it might not always appear at the top.. Try scroll to the bottom

If you're not getting results you expect, please file a bug report and attach a sample project illustrating the issue. If you can post any bug numbers that'll let me track them on our side.

Not able to find the indexed data in spotlight
 
 
Q