How do I force Spotlight to index new folders?
From Apple Support: How to rebuild the Spotlight index on your Mac
- Choose Apple menu () > System Preferences, then click Spotlight.
- Click the Privacy tab.
- Drag the folder or disk that you want to index again to the list of locations that Spotlight is prevented from searching. Or click the Add (+) button and select the folder or disk to add.
To add an item to the Privacy tab, you must have ownership permissions for that item. To learn about permissions, choose Help from the Finder menu bar, then search for “permissions.”- From the same list of locations, select the folder or disk that you just added. Then click the Remove (–) button to remove it from the list.
- Quit System Preferences. Spotlight will reindex the contents of the folder or disk.
Note: Apple Support Document Update: Published Date: Nov 14, 2016 See edit history of this answer to see a previous version of this information.
Note: Dropbox specific information as an addendum to the Apple Support directions.
The above directions are the written ones from Apple Support however with an object like Dropbox on the Sidebar in Finder do not drag and drop it from there, instead either add it to the Privacy tab using the plus ("+") button or drag and drop it from your Home folder. Then remove it using the minus ("-") button.
If Dropbox was removed from the Sidebar in it can be dragged back from one's Home folder.
There are two ways to force indexing on a folder/directory:
mdimport
If the directory is new and has not been indexed before (or even if it resides within a directory structure that has previously been excluded from indexing), mdimport
is your tool of choice:
From a terminal window, type mdimport /path/to/directory
to get indexing started. Possible error messages related to missing or outdated importers for file types found within that path will splatter into your view.
mdutil
To force re-indexing on a previously indexed folder, run mdutil -E
on it as root user. If indexing for a higher level folder (or the entire volue) has been switched of by the user, mdutil will complain (unknown indexing state
in a subfolder, or Indexing and searching disabled.
at the node where the block starts) and refuse indexing. In that case activate indexing for the subtree desired from a user perspective with mdimport
as described above.