I would like to integrate the new Search functionality, but have some questions on if what I'm trying to obtain is possible and if so which approach I should take to implement it.
My app has thousands of "entries" that could be searched and revealed in the app. It's basically a database of the same category of things - none of which is tied to a specific user, these are all static and unique entries that can easily be searched using keywords. It's kind of similar to a database of medial conditions. So I want anyone to be able to search for any of them, even if they don't have the app installed. In trying to figure out how to do this, I have a few questions:
- Do I use NSUserActivity or the CoreSpotlight API for this? NSUserActivity allows you to specify eligibleForPublicIndexing, but I don't see a description or image property to be able to set - only a title. Also it was mentioned you can't let your activity dealloc, I surely can't hold a reference to thousands of entries. But I don't see any way to make an entry publically searchable using CoreSpotlight, this sounds more like what you would use for user-specific searchable content (like documents they created). Though it does allow adding multiple at once, and you don't need to keep a reference for each item.
- This is a scary warning: "Be sure to avoid over-indexing your app content...Because iOS measures the level of user engagement with search results, items that users don’t find useful are quickly identified and can eventually stop showing up in results." This would be very bad for my app. I need all thousands of entries to be searchable, otherwise if some items are missing the search will be unreliable and rendered useless for everyone.
- How do you handle localization? There should only be one item indexed for each entry, but the title and description of the item should be localized and searchable. In fact, when I add them all it will use the same unique identifier but the attributeSet will be different depending on the locale the user is in, how does that pan out?
Thanks for any insight and suggestions you can provide!