---
title: beginBatch()
framework: corespotlight
role: symbol
role_heading: Instance Method
path: corespotlight/cssearchableindex/beginbatch()
---

# beginBatch()

Begins a batch of updates to an index.

## Declaration

```swift
func beginBatch()
```

## Discussion

Discussion Don’t call this method again before endBatch(withClientState:completionHandler:) has returned. (You can call it again before the completion handler passed to endBatch(withClientState:completionHandler:) has been called.)

## See Also

### Batching index updates

- [endBatch(withClientState:completionHandler:)](corespotlight/cssearchableindex/endbatch(withclientstate:completionhandler:).md)
- [endIndexBatch(expectedClientState:newClientState:completionHandler:)](corespotlight/cssearchableindex/endindexbatch(expectedclientstate:newclientstate:completionhandler:).md)
- [fetchLastClientState(completionHandler:)](corespotlight/cssearchableindex/fetchlastclientstate(completionhandler:).md)
