Enabling Spotlight to index excluded directories
 
28/11/2005 - 19:49 (Category: Mac Os X)

By default Spotlight does not index several directories (meaning that you will not be able to see files that you know they *actually do exist* in Spotlight search results). For example, /System, /Library or /etc are excluded from indexing. Anyway, you can configure Spotlight to index excluded directories:

1) open Terminal (Applications -> Utilities -> Terminal.app)
2) type su (at the prompt enter the root password)
3) type cd /.Spotlight-V100
4) type pico _rules.plist

you will see something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
 "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
        <key>EXCLUDE</key> 
        <array/> 
        <key>INCLUDE</key> 
        <array/> 
        <key>NOTE</key> 
        <string>Specify paths to include or exclude, preceeding 
         rules which target user-homes with ~/</string> 
</dict> 
</plist> 
here you can add excluded directories within the 'key' and '/key' tags. For example, if you want to add the /System directory, you must add the following line:

<string>/System</string>

in the _rules.plist file. So you should get something like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
 "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict> 
        <key>EXCLUDE</key> 
        <array/> 
        <key>INCLUDE</key> 
        <array>
        <string>/System</string>
        </array> 
        <key>NOTE</key> 
        <string>Specify paths to include or exclude, preceeding 
         rules which target user-homes with ~/</string> 
</dict> 
</plist> 

notice the <array> and </array> tags (before and after the new added line). After adding the directories to make them indexable, save the _rules.plist file by pressing Ctrl-O, then Enter and finally Ctrl-X to exit the file. To perform the whole job you must be root (take a look at a previous tip in the past tips archive to enable the root user)

Go back

DISCLAIMER:
Any named products on this website are copyright © and/or trademarks ® of their respective companies. INFORMATION ON THIS WEB SITE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. The material included in this site has been compiled from a variety of sources and the site may include technical inaccuracies or typographical errors. Information may be changed or updated without notice. While every effort is made to ensure the correctness of the information provided here, the author can accept no responsibility for damages caused directly or indirectly from the use of such information. The author will not be responsible for damage or loss of data. You are advised to backup data regularly! By entering this site you are agreeing to this and also to never suing the author.

 

Home  About  Mail us!  

Copyright © 1998-2006 Wowarea