Specifications
Chapter 7 Working with Disks and Volumes 95
Understanding Spotlight Technology
Spotlight is a desktop search technology that combines metadata-indexing with
content-indexing that’s optimized for Mac OS X.
When a file is added, moved, deleted, or modified, the file system notifies the Spotlight
engine. The Spotlight engine then updates its index, known as the Spotlight store. The
Spotlight engine then updates applications that use Spotlight, and changes are
reflected dynamically to the user.
The Spotlight store retains information in two indexes, one for metadata and the other
for content. Each index is created on a per-volume basis, which means each disk or
partition carries its own set of indexes for the information about that volume.
Enabling and Disabling Spotlight
By default, the value of the spotlight parameter in the /etc/hostconfig file is set to
-YES-, which means Spotlight is enabled on your Mac OS X Server computer.
To disable Spotlight on your server:
1 Open the /etc/hostconfig file for editing with root privileges using your favorite editor.
For example:
$ sudo pico /etc/hostconfig
2 Change the value of the spotlight parameter to -NO-.
You can set the value of the spotlight parameter to -NO- as follows:
$ sudo /System/Library/ServerSetup/serversetup -setAutoStartSpotlight 0
3 Restart your server.
To enable Spotlight on your server:
1 Open /etc/hostconfig for editing with root privileges.
2 Change the value of the spotlight parameter to -YES-.
You can set the value of the SPOTLIGHT parameter to -YES- as follows:
$ sudo /System/Library/ServerSetup/serversetup -setAutoStartSpotlight 1
3 Restart your server.
Performing Spotlight Searches
Mac OS X provides the ability to view the metadata of a file and perform Spotlight
searches from the command line.
To view a file’s Spotlight metadata, use the mdls tool. This tool, similar to the ls tool,
lists metadata attributes for a file.