"Rich Results" for local items?

Is it possible to get rich Spotlight results for local items? I want to show the "play" button for an audio file locally stored on the device in the search results.


The Spotlight session from the WWDC lists


<div itemscope itemtype=

"http://schema.org/AudioObject">

<meta itemprop="contentUrl" content="http://abc.com/x.m4a" />
</div>


or

<meta property="og:audio" content="http://example.com/music.m4a">

for this. How would I use this? Am I supposed to be able to add that (using the appropriate local file URL) to the HTMLContentData attribute? (Hint: that didn't work for me)





This isn't currently possible for local results. You can only get that by way of Web Markup. If this is something you need, please file a bug report. Yes, it will be marked as a duplicate but having a +1 duplicate helps us understand how many people this impacts.

Is it possible to get sub-title information? All I can seem to get to show up is the NSUserActivity.title and a thumbnail, I am probably just not using the right keys. Will there be better documentation on the keys and what they do? It's feels pretty arcane at the moment.

Ah, I was close, just a little more poking around and I figured it out.


`CSSearchableItemAttributeSet.contentDescription`


It also seems to play well with new lines if you want multi-line information.


So it looks like some of this made it's way into beta 4?


Added CSSearchableItemAttributeSet.containerDisplayName
Added CSSearchableItemAttributeSet.containerIdentifier
Added CSSearchableItemAttributeSet.containerOrder
Added CSSearchableItemAttributeSet.containerTitle
Added CSSearchableItemAttributeSet.supportsNavigation
Added CSSearchableItemAttributeSet.supportsPhoneCall
Added CSSearchableItemAttributeSet(CSActionExtras)
Added CSSearchableItemAttributeSet(CSContainment)


By setting `supportsPhoneCall` to `true` I now get the phone call glyph/button on my result! I wish these had some comments in the headers as to what they all mean.

Based on the (lack of) feedback on my bug report nothing has changed here - I believe that those properties were there before (there are a lot of properties available for the various media types but most won't be displayed in the Spotlight search results). And there is no "supportsPlayingAudio" or something to try and force the Play button.

I am pretty sure those weren't there before, they are stated as Added in the beta 4 diffs, https://developer.apple.com/library/prerelease/ios/releasenotes/General/iOS90SeedAPIDiffs/frameworks/CoreSpotlight.html


They also added actual documentation for the classes, https://developer.apple.com/library/prerelease/ios/documentation/CoreSpotlight/Reference/CoreSpotlight_Framework/index.html#//apple_ref/doc/uid/TP40016250


Unfortunately these new properties are not documented here or in the headers. My bug report has gone untouched (not even marked as a duplicate) as well, but it looks like progress is being made in this area.

Thanks for those links - I always have the hardest time finding the diffs… Let's hope we get to see more properties and documentation soon!

"Rich Results" for local items?
 
 
Q