Recently, VMWare Fusion stopped appearing in Spotlight results. Other queries return expected results, and the spotlight index info for Fusion appears OK at first glance via:
mdls "/Applications/VMWare Fusion.app"
What’s going on, then? To get a different perspective, I tried a Spotlight search in Finder:
… and then saved the results, and examined the resulting XML file with Property List Editor:
It seems there are additional filters in this search that aren’t accounted for in the UI (which is typical Apple, but I digress) such as FinderFilesOnly and UserFilesOnly. I decided to try running the raw query without those extra filters using mdfind, and sure enough:
$ mdfind '(** = "vmware fusion*"cdw) && (kMDItemContentTypeTree=com.apple.application)' /Applications/VMware Fusion.app
A closer look at the mdls output for VMWare Fusion.app reveals the culprit:
$ mdls -name kMDItemSupportFileType /Applications/VMware\ Fusion.app kMDItemSupportFileType = ( MDSystemFile )
Kill it with overwriting but not deleting:
$ sudo xattr -w com.apple.metadata:kMDItemSupportFileType "" /Applications/VMware\ Fusion.app Password: $ mdls -name kMDItemSupportFileType /Applications/VMware\ Fusion.app kMDItemSupportFileType = (null)