Spotlight UI unable to find Core Data external record files inside Sandbox

409 views Asked by At

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?

1

There are 1 answers

1
Jason Harwig On BEST ANSWER

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"];