macOS: Spotlight search shows no result

I think I run into issue similar to the one discussed in this thread: Core Spotlight does not work on macOS


In my case, I am using Core Data integration with Core Spotlight.


I think I have the managed object indexed correctly. Searching using CSSearchQuery in the app returns the indexed result. Deleting index using CSSearchableIndex.deleteAllSearchableItems also works.


But when I search for the same keywords from macOS Spotrligh window, it never list out the object from my app.


An example of the CSSearchableItemAttributeSet look like (object dump from my NSCoreDataCoreSpotlightDelegate subclass):

▿ Optional<CSSearchableItemAttributeSet>
  - some : {
    kMDItemContentType = "public.text";
    kMDItemDisplayName = "Sit vel et ut.";
    kMDItemTextContent = "Est eos adipisci id. Fuga voluptate ratione voluptatem. Ut consequatur ea velit.";
    kMDItemTitle = "Sit vel et ut.";
}


It does feel like Spotlight never look up my app's spotlight index.


Can you folks share how you get the issue resolved? Is it because I am signing the app with development certificate (and provisioning profile)? Will the problem go away if I use the distribution identity to sign the code?


Thanks

Bill