How to index one folder on a (huge) smb shared drive for Spotlight

spotlight

I have a team of a few Mac users in an organisation of about a thousand PC users, all of whom share an Active Directory shared drive which the Mac users connect to with smb.

There's one folder with a few thousand files in many subfolders that the Mac users need to be able to search. I've tried to index it directly and to mount the folder as a volume then index it, but in both cases the standard way seems to not work with folders.

Indexing the whole drive is not an option – It's insanely huge and already has performance issues. Installing smaller physical drives or partitions isn't an option.

How can I index just one shared folder (and its sub folders)?


I've found some vague allusions to mdimport and mdimport -f instead of mdutil (example) but I can't find any clear info on it.

Best Answer

I'm not sure you can index a single folder in quite that way. Indexing starts at drive level…

But how about the other way round?
Tell it to index the drive, then add everything else to Private?
Exclusive rather than inclusive method.

You can do that at the server by adding a file called .metadata_never_index at the top level of each other directory, rather than have to do it at each user's machine from the Spotlight control panel.