Skip to content

Instantly share code, notes, and snippets.

@canering
Forked from kcassam/gist:6707152
Created February 2, 2017 14:12
Show Gist options
  • Save canering/71a939d7666e3caab206bd9bd869ae46 to your computer and use it in GitHub Desktop.
Save canering/71a939d7666e3caab206bd9bd869ae46 to your computer and use it in GitHub Desktop.
Make spotlight index any file

Make spotlight index any file

Problem :

Spotlight was not searching into certain files, even if simple text files (in my case .INI files)

Solution

Easy solution

  • Download TextWrangler.app from the App Store.
  • Reindex (?) mdimport -r /System/Library/Spotlight/RichText.mdimporter

End of story.

Painful solution

  • In terminal, type

mdimport -n -d1 file.extention

You should see one of the above, dependig if the type file is known by the OS or not

  • unknown UTI : Imported 'file.extention' of type 'dyn.ah62d4rv4ge80e2pcr74u'

  • known UTI : Imported 'file.extention' of type 'com.domain.other'

    • Add this type in /System/Library/Spotlight/RichText.mdimporter/Contents/Info.plist (or other mdimporter if appropriate)
    • Reindex mdimport -r /System/Library/Spotlight/RichText.mdimporter

Litterature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment