Does Spotlight index content that resides only on iCloud Drive after local storage is purged? 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?
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