Core Spotlight

RSS for tag

Index your app so users can search the content from Spotlight and Safari using Core Spotlight.

Posts under Core Spotlight tag

9 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

CSUserQuery Generating Model Load Failure - No Results
I'm trying CoreSpotlight on the 18b1 seed on iOS and after submitting my query, I'm getting multiple errors about what looks like missing models: [Model loading] model loading failed with err -1000 for model path /Users/hunter/Library/Developer/CoreSimulator/Devices/0AF4F46E-5510-4458-B61C-F8A153155809/data/Containers/Data/Application/1D8580C0-AC80-4949-9FDA-31DB463BDA5C/Library/Spotlight/Resources_V3/Default/models/spotlight_l2.mlmodelc and directives path /Users/hunter/Library/Developer/CoreSimulator/Devices/0AF4F46E-5510-4458-B61C-F8A153155809/data/Containers/Data/Application/1D8580C0-AC80-4949-9FDA-31DB463BDA5C/Library/Spotlight/Resources_V3/Default/directives/directives_l2.mdplist I am calling CSUserQuery.prepare() but that doesn't seem to make a difference. Is there more to this than what is on this page? https://developer.apple.com/documentation/corespotlight/building-a-search-interface-for-your-app?changes=latest_minor
1
0
94
8h
Are the new Semantic Embeddings in CoreSpotlight multi-lingual?
After watching https://developer.apple.com/wwdc24/10131, I'm curious if the semantic embeddings used to provide the "search of meaning" with this new capability are encoded with multi-lingual embeddings? In particular, if I have content that is mixed in Korean and English, can those be seamlessly indexed together and queries in one language (english) find relevant content that was offered to be indexed as Korean?
0
1
106
2w
Does MacOS Sonoma Spotlight still index non-Apple App Content if indexed?
I've recently upgraded to MacOS Sonoma. Spotlight seems to search third-party app names (search for Outlook and you'll find the Outlook app in search results) but it does not seem to surface third-party app content. Is this expected behavior, a widespread bug, or just my issue? For example, Outlook emails, WhatsApp calls, Evernote notes, Venmo contacts, Booking.com stays, Kayak.com trips...used to all be indexed under their respective apps I'm considering indexing my app but first wondering if Sonoma even supports it anymore? Example of App content::
0
0
438
Nov ’23
iOS Spotlight indexing seems to be broken on iOS 17?
Content indexed through CSSearchableIndex.default().indexSearchableItems() is no longer searchable from Spotlight. I created a very small app to demonstrate this. CSSearchableIndex.default().indexSearchableItems() returned no error, yet the result can't be found. import CoreSpotlight import SwiftUI @main struct testspotlightApp: App { var body: some Scene { WindowGroup { ContentView() .onContinueUserActivity(CSSearchableItemActionType, perform: handleSpotlight) } } func handleSpotlight(_ userActivity: NSUserActivity) { print("Found \(userActivity.userInfo?.debugDescription ?? "nothing")") } } import CoreSpotlight import SwiftUI struct ContentView: View { @State var result = "" var body: some View { VStack { Text("Hello!") Button { let attribute = CSSearchableItemAttributeSet(contentType: .text) attribute.title = "a page title" attribute.contentDescription = "hello this is a page" attribute.keywords = ["search", "this", "page", "title"] let item = CSSearchableItem( uniqueIdentifier: "12345", domainIdentifier: "com.test", attributeSet: attribute) CSSearchableIndex.default().indexSearchableItems([item]) { error in if let error { result = "Failed to index: \(error.localizedDescription)" } else { result = "Successefully indexed to spotlight. Try searching 'a page title'" } } } label: { Text("Index a page").font(.title) } Text(result).multilineTextAlignment(.center) } .padding() } } Has anyone else seen the same issue?
15
9
4.1k
Oct ’23
iOS NSCoreDataCoreSpotlightDelegate, how to reindex all items
I have implemented NSCoreDataCoreSpotlightDelegate, and I missed out the part where the default expirationDate is 1 month, now items that I have added 3 months ago are not showing up in the search index.How do I get NSCoreDataCoreSpotlightDelegate to reindex all the items?I used to be able to call this:mcdcsd.searchableIndex(CSSearchableIndex.default(), reindexAllSearchableItemsWithAcknowledgementHandler: {})And the first time, it will reindex all the items, but if I re-run the app with the above line uncommented again, it will not reindex.If I uninstall the app, install back, then uncomment the above line, then it will index all again for the first time.How do I get it to reindex everything again?
2
0
1.7k
Nov ’23