Search Core Spotlight for Apple Notes and other application content

An increasing number of Apple and third-party applications useCoreSpotlight to index data. This powers both in-app searches as well as the Spotlight menu item.


I am looking for a way to search all application data indexed by CoreSpotlight. For in-app searches, I can use

CSSearchQuery
to find previously submitted
CSSearchableItem
s. I however fail to find API to extend searches to content owned by other applications.


How can I search through all content indexed by CoreSpotlight and replicate the behavior of the Spotlight window?

Replies

As currently designed, Core Spotlight puts each app in its own silo, and only built-in system software can look across the silos. As various subsystems migrate to Core Spotlight, apps that rely on Spotlight’s ability to search across domains are going to run into this limitation more and more. For example, on 10.15 beta, Mail has started using Core Spotlight, as discussed in this thread (which I see you’ve already found).

As to how this will evolve in the future, I can’t speak to that. My only recommendation is that you file an enhancement request for the features that you need (which I see that you’ve done already, per that other thread).

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"