When I create new Dropbox folders, Spotlight does not see them. When does Spotlight index new folders? Or better yet, can 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:
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.
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.
I was also having trouble with indexing when I installed Dropbox. Here is what I recommend.
Don't use Spotlight for file/folder searches. Use Alfred.
Install Alfred. Go to Alfred Preferences. Go to Features --> Default Results. In Search Scope, add the folders you want to be indexed.
Then within Alfred Preferences, go to Advanced -> File/Apps -> Rebuild macOS Metadata --> Delete .Spotlight-V100 Folder and then proceed with the steps that are presented. This YouTube video guides the user through all this.
If you don't find some of the above options, you may need to purchase the Powerpack feature of Alfred from here. After all this, your indexed files should start showing up in Alfred and Spotlight searches.