Spotlight only finds titles, not contentDescription using CoreSpotlight in iOS 18 AppIntents
I’m implementing Spotlight search for notes app, using iOS 18’s AppIntents and CoreSpotlight. While my notes are indexed, the transcript and aiSummary fields (assigned to contentDescription and textContent) aren’t appearing in search results.
Current Implementation:
Indexing Setup:
@available(iOS 18.0, *)
struct NoteEntryEntity: AppEntity, IndexedEntity, Identifiable {
// ...
var attributeSet: CSSearchableItemAttributeSet {
let attributeSet = defaultAttributeSet
attributeSet.title = title
attributeSet.contentDescription = transcript
attributeSet.textContent = [transcript, aiSummary].compactMap { $0 }.joined(separator: "\n\n")
attributeSet.keywords = (noteTags?.compactMap { $0.name } ?? [])
return attributeSet
}
}
Problem: Spotlight only finds titles, not transcript/aiSummary content.
Question: How does spotlight support search for content description?
iPhone 16 Pro