Is there a limit for number of items (CSSearchableItem) in Core Spotlight CSSearchableIndex in iOS 9?
Asked Answered
I

3

14

I have around 110,000 entries (CSSearchableItem) that I want to index into iOS 9 Spotlight Search results. However I only managed to show around 30,000 items. The rest was never indexed / appeared when I do the search. So I'm not really sure if there's a limit for an app to to index its entries into the system.

Thanks.

Iorgos answered 9/2, 2016 at 4:58 Comment(4)
There is an item count limit of 32767.Unsettled
@Imakemymark where did you get this magic number from? Did you test it?Acquiescent
@Acquiescent it's a limitation in macOS.Unsettled
@Imakemymark question is for iOS....Acquiescent
P
3

There shouldn't be any limit for your CSSearchableItem. Are you sure that every item has added? I suggest:

  • check the completion block when you add your items for see if you have some errors.
  • check this beautiful post, maybe you did a simple error.
Pressman answered 15/2, 2016 at 17:45 Comment(0)
H
1

iOS 16 here. Trying to index more than 32767 items gives me this error:

[index] Item count 78394 exceeded limit 32767

So I guess there is a 32767 items limit.

Herbst answered 14/9, 2022 at 23:19 Comment(0)
D
1

Skoua's guess is partially correct.

try await CSSearchableIndex.default().indexSearchableItems(items)

If you have more than 32767 items, you may call indexSearchableItems() multiple times to index them all.

For example, if you have 50,000 items, then call indexSearchableItems() 50 times and index 1000 items each time.

BTW, I got 131312 items indexed in my app. Maybe more can be indexed, but I have not tested that.

Daffy answered 6/7, 2023 at 5:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.