0

I'm developping a mobile application for ios device and i have an issue!

My app contain a search system and i want to expose my system into spotlight in IOS. I had found some informations but it's to put some selected item ! It's not dynamic ! Our database contains more than 100 000 rows. So it's not possible to put every data in spotlight search engine !

So, my question is that, can i linked Spotlight to my API to allow my users to search directely in spotlight?

Thank!

Clowning
  • 178
  • 4
  • 16

2 Answers2

1

Nope, this is certainly not possible. Imagine every developer would like to do something like this – users would end with a device containing 10+GB index of data they will never reasonably use. CoreSpotlight index is pretty much limited per app to a specific amount of data you store there. You can do some batch indexing but can't get around the eligible limits Apple set for this feature.

TL;DR: Spotlight is meant for data users can be very likely interested in (based f.e. on the fact they've already watched it or they've watched related/similar content). It's not meant to replace your in-app search.

Michi
  • 1,464
  • 12
  • 15
  • Hey Michi, first of all, thank for your response ! It's why i said "So, my question is that, can i linked Spotlight to my API to allow my users to search directely in spotlight?" With this way, i don't have to store every rows in spotlight ! I have see something called "Web Markup" but there are not lot of informations about that ! It's maybe a solution ? Just suggest to spotlight to call my api to have data about the search! – Clowning Mar 04 '17 at 10:56
1

While Spotlight does handle fairly big amounts of entries (in the order of hundreds to thousands), it's a good idea not trying to put ~100.000 entries in there (also because your app would be in charge to update them over time).

You could think of adding "proxy" entries to Spotlight, e.g., your data/domain categories. If you were to implement an accomodation booking app, you could add entries like "Hotel", "Hostel" and many more (including specific entries like the top items and user-selected favorites/current bookings) into Spotlight, along with appropriate keywords for each. If a user selects one of those in Spotlight, your app will open and can perform the actual search.

In iOS 10, there's a dedicated API for continuing Spotlight searches. You still have to provide a Spotlight entry first that matches the user's search term in Spotlight, so it's not all that different from the approach I outlined above.

There's no way to search within your app as the user types into Spotlight.

hagi
  • 11,503
  • 3
  • 35
  • 48