---
title: "deleteAllSearchableItems(completionHandler:)"
framework: corespotlight
role: symbol
role_heading: Instance Method
path: "corespotlight/cssearchableindex/deleteallsearchableitems(completionhandler:)"
---

# deleteAllSearchableItems(completionHandler:)

Deletes all searchable items from the index.

## Declaration

```swift
func deleteAllSearchableItems(completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
```

```swift
func deleteAllSearchableItems() async throws
```

## Parameters

- `completionHandler`: The block that’s called when the request has been journaled by the index (“journaled” means that the index makes a note that it has to perform this operation). Note that the request may not have completed. The block receives the following parameter:

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func deleteAllSearchableItems() async throws For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously.

## See Also

### Managing items in an index

- [indexSearchableItems(_:completionHandler:)](corespotlight/cssearchableindex/indexsearchableitems(_:completionhandler:).md)
- [deleteSearchableItems(withDomainIdentifiers:completionHandler:)](corespotlight/cssearchableindex/deletesearchableitems(withdomainidentifiers:completionhandler:).md)
- [deleteSearchableItems(withIdentifiers:completionHandler:)](corespotlight/cssearchableindex/deletesearchableitems(withidentifiers:completionhandler:).md)
