2

I have a directory of plain text files in ~/Library/Application Support/MyApp/Spotlight/. I understand that Spotlight stopped indexing the Library in 10.5, but is there a way to force Spotlight to include a single sub-directory in its index?

I've tried wrapping mdimport in an NSTask, and the debug output says that the file has been imported, but it does not show up in Spotlight results.

@bbum's answer here leads me to believe this should be trivial, but I'm at a loss.

Any help or pointers are greatly appreciated.

Thanks.

Community
  • 1
  • 1
iBuys
  • 65
  • 7
  • 5
    To those voting to close based on "off-topic", the OP is specifically mentioning using NSTask (a Cocoa class) to do this programmatically. It is NOT off-topic. It's important to note that non-document-based applications usually store information in the Application Support folder and use a single database, which means you must go the extra mile to get your information indexed if you want one-Spotlight-result-per-record. Think before you vote to close, please. – Joshua Nozzi Feb 04 '11 at 20:43

1 Answers1

2

It seems like Spotlight does find your files if you place them in ~/Caches/Metadata/$(YOUR_APP_NAME). This is where Safari also puts its bookmark metadata to be indexed by Spotlight.

Martijn Thé
  • 4,674
  • 3
  • 29
  • 42