Spotlight support
I recently work on coredata and spotlight integration https://developer.apple.com/videos/play/wwdc2017/210/
Apple introduces a few things NSCoreDataCoreSpotlightDelegate
container.persistentStoreDescriptions.forEach {
$0.setOption(MyCoreDataCoreSpotlightDelegate(forStoreWith:$0,
model: container.managedObjectModel),
forKey:NSCoreDataCoreSpotlightExporter)
}
I wonder how to integrate spotlight and coredata using corestore.
I did not find any api exposed by corestore to allow me to do that, the closet thing I can find is storageOption in StorageInterface. However I set it , I will need to have both NSPersistentStoreDescription and NSManagedObjectModel
var storage = SQLiteStore(fileName: "contents.sqlite",
localStorageOptions: .allowSynchronousLightweightMigration
)
storage.storeOptions = [NSCoreDataCoreSpotlightExporter:MySpotLightDelegate(forStoreWith: <#T##NSPersistentStoreDescription#>, model: <#T##NSManagedObjectModel#>)]
dataStack.addStorage(
SQLiteStore(fileName: "contents.sqlite",
localStorageOptions: .allowSynchronousLightweightMigration)
not sure what should I put into storeOptions
The store must have persistent history tracking enabled to use NSCoreDataCoreSpotlightDelegate, but CoreStore have not. https://github.com/JohnEstropia/CoreStore/issues/295