Spotlight

From Applepedia

Jump to: navigation, search
Spotlight
Image:Spotlight.png
Min/Max OS Support 10.4
License System Software
Category Search
Installer No
PowerPC Traitor {{{universal}}}
Website Apple's Spotlight page

Contents

What is Spotlight and How Does it Work?

Spotlight is the new metadata searching system for Mac OS 10.4 Tiger. It is capable of (near) instantaneous results from user search queries. Search queries may include filesystem metadata including file names, types, creation and modification dates, etc. Metadata derived from the contents of a particular file type may also be used. For instance, spotlight can search the contents of .doc, PDF and any other file type for which an importer has been built. See the section What does Spotlight index? for more information on filetypes compatabile with Spotlight.

The power of Spotlight comes from the speed at which it generates search results and indexes data. Spotlight differs from older searching systems in that the filesystem need not be completely recatalogued periodically. All file indexing that occurs takes place as files are created and modified. Whenever a file is created or modified the kernel notifies Spotlight of the change. If there is a file importer available and the user has specified that Spotlight should index that particular file type then metadata is extracted from the file and immediately capable of being searched. This means that there is never a discrepancy between what the search system knows about the filesystem and the actual state of the filesystem.

What does Spotlight index?

See the file importers in /System/Library/Spotlight and /Library/Spotlight

Disabling Spotlight

The best idea is to just uncheck everything in the Spotlight Preference Pane. Another option would be to run "mdutil -i off /" like so

$ sudo mdutil -i off /Volumes/your_volume_name_1
$ sudo mdutil -i off /Volumes/your_volume_name_2

Warning: This will probably break MacOS X. If you really really want Spotlight not to be able to run, try deleting the following files:

  • /Library/Spotlight/* (these are all importers for spotlight data)
  • /usr/bin/md* (these are some of spotlight's indexing tools)
  • /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Support/* (these are the rest of spotlight's indexing tools)

Deleting Spotlight indexes

Deleting the indexes can be done with mdutil also

sudo mdutil -E /Volumes/your_volume_name_1
sudo mdutil -E /Volumes/your_volume_name_2

Otherwise, you can delete the indexes manually using rm at the Terminal

For the root partition

$ sudo rm -rf /.Spotlight-V100

For all other volumes

$ sudo rm -rf /Volumes/volume_name/.Spotlight-V100' in the Terminal to remove the index for any other partition.

Boolean Searching in Spotlight

Spotlight has limited support for boolean operators in it's search methods. Try using | (pipe) as a boolean OR. (-term) works as a boolean NOT.

"'Bob|Jane'" would therefor return all results of "Bob" or results of "Jane" Fun, huh?

"'Bob(-Jane)'" would result in all "Bob"'s with no "Jane"'s.

See also

Personal tools