I am having issue with making Core Data searchable using Core Spotlight in iOS. I checked Index For Spotlight
for some attributes like name, date modified for a. I subclassed NSCoreDataCoreSpotlightDelegate
and called setOption(spotlightDelegate, forKey: NSCoreDataCoreSpotlightExporter)
on persistent container's store description before loading persistent stores. In the logs, CoreData prints that it has successfully initialised by NSCoreDataCoreSpotlightDelegate
subclass, but I am not able to see any record in spotlight.
Do I have to set Spotlight Display Name for entity also?
I know this thread is old but I would recommend you check out https://developer.apple.com/wwdc21/10098. This session is all about the updates to the NSCoreDataCoreSpotlightDelegate in iOS 15.
There is an associated sample application to demonstrate how these new capabilities work.