Opens an existing, named index for searching only.


func SKIndexOpenWithData(_ inData: CFData!, _ inIndexName: CFString!) -> Unmanaged<SKIndex>!



The index to open.


The name of the index. Can be NULL, in which case this function attempts to open the index with the default name of IADefaultIndex.

Return Value

The named index, or NULL on failure.


An index opened by SKIndexOpenWithData can be searched but not updated. To open an index for updating, use SKIndexOpenWithMutableData(_:_:).

If inIndexName is NULL and inData does not contain an index with the default name, this function returns NULL.

Search Kit is thread-safe. You can use separate indexing and searching threads. Your application is responsible for ensuring that no more than one process is open at a time for writing to an index.

A call to SKIndexOpenWithData retains the opened index. When your application no longer needs the index, dispose of it by calling SKIndexClose(_:).

Special Considerations

You cannot use CFMakeCollectable with SKIndex objects.

See Also

Creating, Opening, and Closing Indexes

func SKIndexCreateWithURL(CFURL!, CFString!, SKIndexType, CFDictionary!)

Creates a named index in a file whose location is specified with a CFURL object.

func SKIndexOpenWithMutableData(CFMutableData!, CFString!)

Opens an existing, named index for searching and updating.

func SKIndexOpenWithURL(CFURL!, CFString!, Bool)

Opens an existing, named index stored in a file whose location is specified with a CFURL object.

func SKIndexGetIndexType(SKIndex!)

Gets the category of an index.

func SKIndexGetTypeID()

Gets the type identifier for Search Kit indexes.