Spotlight extensions enhance third-party app searches, letting you look up more app-specific content. Here’s how to enable or disable the extensions in macOS.
Spotlight is Apple’s search indexing technology, which speeds up searches of data on your Mac or iOS device by storing metadata about files and their contents.
From time to time, macOS runs a process in the background to catalog the files and data on your storage devices. This data is stored in an index that Spotlight can use to look up data when you do a search in the future.
Keeping indices on your data speeds up searches and allows Spotlight to locate the data you’re looking for more quickly.
You can also stop Spotlight from searching specific storage volumes or folders. You can do this by adding them to the System Settings app under the Spotlight->Search Privacy sheet.
Spotlight extensions for third-party apps
Some third-party macOS apps include the ability to provide their custom data to Spotlight by means of Extensions. These are small chunks of code that the app developer provides, which Spotlight can use to include custom data in its index.
Extensions make Spotlight searches even faster because they tell Spotlight what data each app uses and how it is structured. By providing Spotlight Extensions, third-party apps in effect tell Spotlight how to quickly and efficiently search and index the data files those apps create.
When you add a new app to your Mac, Spotlight Extensions are automatically added if the app includes them. These are usually included inside each app’s bundle (folder) in the /Contants/Library/Spotlight folder as .mdimporter files (which themselves are bundles).
Enabling/disabling Spotlight extensions for third-party apps
In macOS Sequoia, you can decide which apps’ Spotlight Extensions you want enabled or disabled. Turning off a Spotlight Extension in System Settings removes the app-specific info for that app from Spotlight.
You might want to do this, for example, if you don’t want Spotlight to have additional info about how certain apps’ data or metadata is structured.
Note that disabling a Spotlight Extension doesn’t stop Spotlight from indexing those kinds of files. All it does is stop Spotlight from having knowledge of the internal workings of the app’s data structure and metadata.
To enable or disable a Spotlight Extension for a specific app, go to System Settings->General->Login Items & Extensions->Spotlight and then click the small Info button on the right. This opens the Spotlight Extensions sheet:
For each app listed, flip the switch on the right to enable or disable Spotlight’s ability to have access to that app’s data.
There are also several command-line Spotlight utilities you can use in the macOS Terminal, such as mdutil
and mdfind
. For more info on how to use macOS’s command-line Spotlight utilities, see our previous articles How to use Spotlight’s metadata file utilities in macOS and How to get more from Spotlight on the Mac.
If you’re a developer, be sure to read the main Spotlight Foundation API Apple documentation and the File Metadata section of the Core Services documentation.
The two main classes you’ll be working with are NSMetadataQuery
and NSMetadataItem
.
Be aware that writing Spotlight Extensions and using the Spotlight search APIs in your app are two different things.
Next, read the fairly dated Spotlight Importer Programming Guide and File Metadata Search Programming Guide.
If you’re using Core Data, see Core Data Spotlight Integration Programming Guide.