---
title: "init(name:)"
framework: corespotlight
role: symbol
role_heading: Initializer
path: "corespotlight/cssearchableindex/init(name:)"
---

# init(name:)

Returns an on-device index with the specified name.

## Declaration

```swift
init(name: String)
```

## Parameters

- `name`: A name that pertains to your custom organization.

## Return Value

Return Value An on-device index.

## Discussion

Discussion If you want to use batching or you want to index items in a specific protection class, you need to use your own index (you can’t perform batch updates on the default index).

## See Also

### Creating an index

- [default()](corespotlight/cssearchableindex/default().md)
- [init(name:protectionClass:)](corespotlight/cssearchableindex/init(name:protectionclass:).md)
