Unpredicatable ordering of search results with CSSearchableIndex in Core Spotlight

Originator:poppoppop
Number:rdar://23235536 Date Originated:23-Oct-2015 04:58 PM
Status:Open Resolved:
Product:iOS SDK Product Version:9.1
Classification:Other Bug Reproducible:Always
 
Summary:
When indexing content with CSSearchableIndex search results are often unpredictable. The particular context for the issue we’ve run into is as follows: we want to index all of a user’s subscribed podcasts, and the episodes of those podcasts, so that they can easily find them through spotlight. However, if we index all episodes of a podcast then search results don’t have a clear priority. For example a search for “Sample Podcast” would return a seemingly random selection of episodes of that podcast rather than the podcast itself or the latest episodes. We’ve fallen back to just indexing podcasts rather than individual episodes, but this is less powerful a feature for users.

Steps to Reproduce:
1. Run the attached sample project
2. It indexes an individual podcast, and 99 episodes of the same podcast
3. Do a spotlight search for “Sample Podcast”, the name of this podcast

Expected Results:
Spotlight shows a search result for “Sample Podcast” and/or a selection of the latest episodes

Actual Results:
Spotlight shows episodes 88, 89, and 90

Regression:
Tested on device and in simulator, iOS 9.0 and 9.1

Notes:
Sample project available at https://github.com/prendio2/CoreSpotlightSample

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!