9

I want to use iCloud Drive to sync the Documents folder. When I run out of disk space macOS will free up space by removing old content on my SDD.

My question is, will that also remove Spotlight's knowledge (that is the meta data) of these files?

6

Yes Spotlight is indexing iCloud Drive. It could take a while before your iCloud Drive is indexed.

Spotlight even shows if the file you are looking for is located in iCloud Drive.

To test if the metadata is still working after the file is purged I did:

  • Added test333 in the file comments
  • Moved it to iCloud Drive
  • Occupied a lot of space with an empty disk image
  • The system purged the file
  • Searched for the comment

Screenshot Spotlight & Finder

  • 1
    And we are talking about meta data here, not only the file name? – TOMvonMOM Dec 15 '16 at 14:20
  • The hard part is forcing the file on the drive to get "purged" due to a low space event and then verify the metadata is still searchable. You can use mdls and mdfind to script your tests and gather data about test files, but waiting or causing the purge is going to be a more lengthy or involved process IMO. – bmike Dec 15 '16 at 14:24
  • @bmike good point! – LH16 Dec 15 '16 at 14:39
  • Purging was easy. Just threaten the system to copy over a 100GB folder from external HD. That will do the trick. – TOMvonMOM Dec 15 '16 at 14:40
  • It is even easier, just make an empty disk image of x GB.. and the system starts purging. Changed my answer.. could still find a file under a comment after it was purged. – LH16 Dec 15 '16 at 15:39
4

No metadata index is only searchable when iCloud documents are purged or not stored locally. A file only gets indexed when it’s written through the local filesystem and the metadata index gets updated.

Spotlight only indexes a local drive in my testing of 10.12.2 so I would expect you to lose the spotlight search data for any files that initially are downloaded to your Mac but then get purged in a low disk space pruning of the local cache of files.

There are mechanisms for macOS to maintain a spotlight index from a remote network volume and it also is conceivable Apple could engineer a solution where the spotlight metadata is kept locally when the prune occurs. I just can't verify that the implementation is performed or complete.

If I am able to get a test case, I will edit this answer with details but the work to set that up for me are more hassle than my curiosity at the moment. It would be fairly easy to set this up if you bumped your storage to 50 GB for one month and installed macOS with a boot drive less than 50 GB.

  • Exactly what I am testing out. Bumped iCloud to 200GB and told my documents folder (147GB) to get over there. Spotlight worked fine until I purged the Macs HD. Then all Spotlight gave me was filename hits, no meta data (such as text content from Keynote/Pages/PDF). – TOMvonMOM Dec 19 '16 at 9:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .