Invokes all pending updates associated with an index, compacts the index if compaction is needed, and commits all changes to backing store.
- macOS 10.3+
- Core Services
The index you want to compact.
A Boolean value of
true on success, or
false on failure.
Over time, as document URL objects (of type
SKDocument) and associated contents get added to and removed from an index, the index’s disk or memory footprint may grow due to fragmentation.
Compacting can take a significant amount of time. Do not call
SKIndex on the main thread in an application with a user interface. Call it only if the index is significantly fragmented and according to the needs of your application.
SKIndex changes the block allocation for an index’s backing store. Close all clients of an index before calling this function.