Search code examples
indexingcloudkit

CloudKit Dashboard index queryable, sortable and searchable


I need to be able to search a field of type NSString in CloudKit records. I found a comment saying that there used to be a searchable index type for fields. Now there are only queryable and sortable. What do I set the index type for the field in order to be able to search for a specific string in a field in all the records?

Also, does one option include the other? I mean is one of the options inclusive of the other? For example, if I choose queryable, does that mean the field is also sortable, whereas when I choose sortable it only makes it sortable but not queryable? Or if I want to choose both, would I have to create separate indexes, one for queryable and one for sortable?


Solution

  • You can still set the index type to searchable, there are 3 types: Queryable, Sortable and Searchable.

    One option does not include the other, so yes you will have to create separate indexes if you wish to have the field queryable and sortable.