Spotlight Metadata Attributes

The first step in providing support for Spotlight is to decide what information a user will want to look for in documents they create using your application. Once you determine the data that should be extracted and provided to users, you need to assign those values to metadata attributes.

Spotlight defines standard metadata attributes that provide a wide range of options for storing your document’s metadata. Users can restrict searching to specific attributes, and so it is important that you should use Spotlight’s standard metadata attributes whenever possible.

For example, many documents contain a company name that should be extracted as metadata. Spotlight doesn’t provide an explicit company name attribute. It does, however, define an attribute that stores an “organization”—kMDitemOrganizations—which is appropriate for a company name. The Spotlight provided metadata attributes are documented in File Metadata Attributes Reference.

If an appropriate metadata attribute isn’t provided by Spotlight, you should look to third-party developers to see if they have already defined an appropriate attribute key. If no appropriate Spotlight or third-party metadata attribute has been defined, then you can create your own custom metadata attributes.