---
title: "SKIndexOpenWithURL(_:_:_:)"
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.3+]
path: coreservices/1449017-skindexopenwithurl
---

# SKIndexOpenWithURL(_:_:_:)

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

## Declaration

```swift
func SKIndexOpenWithURL(_ inURL: CFURL!, _ inIndexName: CFString!, _ inWriteAccess: Bool) -> Unmanaged<SKIndex>!
```

## Parameters

- `inURL`: The location of the index.
- `inIndexName`: The name of the index. Can be NULL, in which case this function attempts to open the index with the default name of IADefaultIndex.
- `inWriteAccess`: A Boolean value indicating whether the index is open for updating. To open an index for searching only, pass false (0 or kCFBoolenFalse). To open it for searching and updating, pass true (1 or kCFBooleanTrue).

## Return Value

Return Value The named index, or NULL on failure.

## Discussion

Discussion If inIndexName is NULL and inData does not contain an index with the default name, this function returns NULL. A call to SKIndexOpenWithURL retains the opened index. When your application no longer needs the index, dispose of it by calling SKIndexClose(_:). 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. Special Considerations You cannot use CFMakeCollectable with SKIndex objects.

## See Also

### Creating, Opening, and Closing Indexes

- [SKIndexCreateWithURL(_:_:_:_:)](coreservices/1446111-skindexcreatewithurl.md)
- [SKIndexCreateWithMutableData(_:_:_:_:)](coreservices/1447500-skindexcreatewithmutabledata.md)
- [SKIndexOpenWithData(_:_:)](coreservices/1446398-skindexopenwithdata.md)
- [SKIndexOpenWithMutableData(_:_:)](coreservices/1444201-skindexopenwithmutabledata.md)
- [SKIndexClose(_:)](coreservices/1442401-skindexclose.md)
- [SKIndexGetIndexType(_:)](coreservices/1442236-skindexgetindextype.md)
- [SKIndexGetTypeID()](coreservices/1450223-skindexgettypeid.md)
