Hakan Or
Hakan Or

Reputation: 55

How can I make my app appear higher than all other apps in Spotlight search results?

I’m working on an iOS application and would like to improve its visibility in Spotlight search results. Specifically, I want my app’s content to appear higher in the search results compared to other apps.

Here are a few details about my setup:

import CoreSpotlight
import MobileCoreServices

func indexListItems(items: [MyListItem]) {
    var searchableItems: [CSSearchableItem] = []
    
    for item in items {
        let attributeSet = CSSearchableItemAttributeSet(itemContentType: kUTTypeText as String)
        attributeSet.title = item.title
        attributeSet.contentDescription = item.description
        
        let searchableItem = CSSearchableItem(uniqueIdentifier: "\(item.id)", domainIdentifier: "com.myapp.list", attributeSet: attributeSet)
        searchableItems.append(searchableItem)
    }
    
    CSSearchableIndex.default().indexSearchableItems(searchableItems) { error in
        if let error = error {
            print("Indexing error: \(error.localizedDescription)")
        } else {
            print("Successfully indexed items.")
        }
    }
}

For example, even though I set the title and contentDescription of an item in my app to “Accessibility,” it still appears below the System Settings’ Accessibility entry. I understand that the Settings app is a system app and might have a higher priority, but I still want my app to appear higher in the results.

Could you provide any tips or best practices for optimizing my app’s content to improve its ranking in Spotlight search results? Are there specific attributes or techniques that can help prioritize my app over others?

Upvotes: 0

Views: 199

Answers (1)

Soham Karalkar
Soham Karalkar

Reputation: 43

Forgive me if I don't answer your question fully.

Siri Spotlight suggestions are ranked by amount of use, if you frequent your app more, Siri will start displaying that app higher in the spotlight results feature. Siri is an adaptive AI, it changes your device according to your needs unless there is any other way, the only option you have is to use your app more.

Upvotes: 2

Related Questions