1

I've followed the instructions to integrate spotlight into a non-document based Core Data application using Record-Level Indexing. The spotlight importer imports the files correctly and those records can be found using mdfind "some string".

The problem is the spotlight user interface – the magnifying glass in the top right – doesn't show these records when running inside the sandbox.

The external record files are created in ~/Library/Containers/[my app]/Data/Library/Caches/Metadata/CoreData/[my app]

Am I doing something wrong?

Community
  • 1
  • 1
Jason Harwig
  • 43,743
  • 5
  • 43
  • 44

1 Answers1

2

Comparing the results of mdimport -d2 [external record file] showed this extra property:

kMDItemSupportFileType =     (
    MDSystemFile
);

Adjusting the spotlight importer to remove this key seems to fix it. The results are now shown in the spotlight UI. I'm guessing it hides system files from the results.

[spotlightData removeObjectForKey:@"kMDItemSupportFileType"];
Jason Harwig
  • 43,743
  • 5
  • 43
  • 44
  • is there anyway you share some basic code here. I just cant seem to get it from the "Record level indexing" page of apple docs. – user134611 Jan 27 '14 at 02:56