Spotlight results | AppShortcut with AppEntity parameter vs CSSearchableItem.associateAppEntity

I've been exploring the Trails Sample App from this session at WWDC24.

The app has a TrailEntity of type AppEntity which is leveraged in multiple places throughout the app, including:

  1. The GetTrailInfo App Intent with a trail parameter of type TrailEntity.
  2. A parameterized App Shortcut which calls the GetTrailInfo intent.
  3. The TrailDataManager's init calls updateSpotlightIndex(), which creates a CSSearchableItem for each Trail in the app, along with an associateAppEntity call linking the corresponding TrailEntity to each item that gets added to the CSSearchableIndex.

If you build the app and search "trails" in Spotlight, the Trails Sample App section includes instances of TrailEntity as search results. But if you comment out the App Shortcut that takes a TrailEntity as a parameter and rebuild, there are no instances of TrailEntity in the search results. In both cases, the console prints [Spotlight] Trails indexed by Spotlight.

Is this expected behavior? Why are the TrailEntity instances only appearing in Spotlight via the App Shortcut? Shouldn't the CSSearchableItem instances show up in Spotlight on their own regardless? If not, then what is the purpose of adopting Core Spotlight with App Entities? Does this add the app entities to the semantic index for "new Siri", even though they're not user facing in the Spotlight UI?

Spotlight results | AppShortcut with AppEntity parameter vs CSSearchableItem.associateAppEntity
 
 
Q