Using Spotlight index on a file share on Server.app

I have a Mac mini server (Server.app 5.0.15 on El Capitan 10.11.2), and that connects to a file share on another Mac mini, also with El Capitan 10.11.2.

Spotlight indexes for the file shares are not available on the client, so I can't do efficient searches on the file shares.

What should be done to enable file share indexes, and where:

  • on the server El Capitan?
  • on Server.app?
  • on the client?

I have seen lots of discussions about successful mdutil trickery, but all are with OS X before 10.11 and Server.app before 5.0.15. My research of Apple Server Help seems to be absolutely quiet about spotlight or indexing.

What can I do have the Mac mini client index the share on another Mac that runs Server.app?


Solution 1:

It looks like mdutil can see that server search is enabled:

$ sudo mdutil -s /Volumes/YourNetworkDrive
  /Volumes/YourNetworkDrive:
           Server search enabled.

Also the mdutil manpage has this information for the -p option:

-p  Spotlight caches indexes of some network devices locally. 
This option requests that a local caches be flushed to the
appropriate network device.

However, for me this does not seem to work, and it doesn't show remote search results anywhere when using SMB network mounts (This is in macOS Sierra).

There is one officially supported way to query remote Spotlight indexes, by using the Apple Remote Desktop application. Apple Remote Desktop is not free, but can be purchased through the Mac App Store ($79.99).

However, this a separate app and it does not integrate the remote index with local Spotlight searches. It works well though.

From the features page:

Remote Spotlight search

Leveraging the revolutionary Spotlight technology in OS X, the Remote Spotlight capability in Apple Remote Desktop can perform lightning-fast searches on remote client systems. Summary results for each client are updated instantly as results are returned. View details on results, or refine searches even further using additional qualifiers. Results can be viewed on remote client systems, copied back to your administrator system, or deleted.

A screenshot from the product page:

Apple remote desktop remote spotlight search window screenshot

Solution 2:

What I have just figured out about searching network volumes is that Spotlight search and the Finder search field are not the same, and the Finder search is better — for this use case, anyway. The main SPACE Spotlight search only shows files from your computer (and dictionary entries, contacts, websites, etc), and even then it doesn't seem to search the contents of all files.

However, opening a Finder window and using that search bar gets you the full power of both Spotlight's index and the indexes on network volumes. I have Synology's Universal Search indexing enabled on a bunch of my NAS folders, and a Finder search with "Shared" (instead of "This Mac") selected shows me every file in my multi-terabyte archive that contains my search string in the contents, and it shows them reasonably fast; it loads a few hundred to start, then loads 50 more results every few seconds until finished. No hangs and no beachballs (though no spinner to indicate more results coming, either).

I know my experience isn't with macOS Server (which I gather isn't much of a thing anymore), but for anyone using with this problem with SMB volumes, I suspect that Finder search will be way more fruitful than the main Spotlight window.