{"id":855,"date":"2015-12-06T17:51:18","date_gmt":"2015-12-07T00:51:18","guid":{"rendered":"https:\/\/dreness.com\/blog\/?p=855"},"modified":"2015-12-06T17:51:18","modified_gmt":"2015-12-07T00:51:18","slug":"spotlight-userfilesonly-kmditemsupportfiletype-and-mdsystemfile","status":"publish","type":"post","link":"https:\/\/dreness.com\/blog\/archives\/855","title":{"rendered":"Spotlight, UserFilesOnly, kMDItemSupportFileType, and MDSystemFile"},"content":{"rendered":"<p>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:<\/p>\n<pre>mdls \"\/Applications\/VMWare Fusion.app\"<\/pre>\n<p>What&#8217;s going on, then? To get a different perspective, I tried a Spotlight search in Finder:<\/p>\n<p><a href=\"https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/before.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-857\" src=\"https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/before.png\" alt=\"before\" width=\"770\" height=\"478\" srcset=\"https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/before.png 770w, https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/before-300x186.png 300w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/a>&#8230; and then saved the results, and examined the resulting XML file\u00a0with Property List Editor:<\/p>\n<p><a href=\"https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/query-plist-editor.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-860\" src=\"https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/query-plist-editor.png\" alt=\"query plist editor\" width=\"824\" height=\"438\" srcset=\"https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/query-plist-editor.png 824w, https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/query-plist-editor-300x159.png 300w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/a>It seems there are additional filters in this search that aren&#8217;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\u00a0mdfind, and sure enough:<\/p>\n<pre>$ mdfind '(** = \"vmware fusion*\"cdw) &amp;&amp; (kMDItemContentTypeTree=com.apple.application)'\r\n\/Applications\/VMware Fusion.app<\/pre>\n<p>A closer look at the mdls output for VMWare Fusion.app reveals the culprit:<\/p>\n<pre>$ mdls -name kMDItemSupportFileType \/Applications\/VMware\\ Fusion.app\r\nkMDItemSupportFileType = (\r\n    MDSystemFile\r\n)<\/pre>\n<p>Kill it with overwriting but not deleting:<\/p>\n<pre>$ sudo xattr -w com.apple.metadata:kMDItemSupportFileType \"\" \/Applications\/VMware\\ Fusion.app\r\nPassword:\r\n$ mdls -name kMDItemSupportFileType \/Applications\/VMware\\ Fusion.app\r\nkMDItemSupportFileType = (null)<\/pre>\n<p>&#8230; and now everything&#8217;s OK again:<br \/>\n<a href=\"https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/after.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-858\" src=\"https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/after.png\" alt=\"after\" width=\"770\" height=\"478\" srcset=\"https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/after.png 770w, https:\/\/dreness.com\/blog\/wp-content\/uploads\/2015\/12\/after-300x186.png 300w\" sizes=\"auto, (max-width: 770px) 100vw, 770px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;\/Applications\/VMWare Fusion.app&#8221; What&#8217;s going on, then? To get a different perspective, I tried &hellip; <a href=\"https:\/\/dreness.com\/blog\/archives\/855\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-855","post","type-post","status-publish","format-standard","hentry","category-os-x"],"_links":{"self":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/855","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/comments?post=855"}],"version-history":[{"count":6,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/855\/revisions"}],"predecessor-version":[{"id":864,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/855\/revisions\/864"}],"wp:attachment":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/media?parent=855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/categories?post=855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/tags?post=855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}