---
title: "deleteAppEntities(identifiedBy:ofType:)"
framework: corespotlight
role: symbol
role_heading: Instance Method
path: "corespotlight/cssearchableindex/deleteappentities(identifiedby:oftype:)"
---

# deleteAppEntities(identifiedBy:ofType:)

Deletes entities with the specified identifiers and type from the current index.

## Declaration

```swift
func deleteAppEntities<Entity>(identifiedBy identifiers: [Entity.ID], ofType type: Entity.Type) async throws where Entity : IndexedEntity
```

## Parameters

- `identifiers`: The IDs of the entities you want to delete. Get the identifier value of an entity from its doc://com.apple.documentation/documentation/Swift/Identifiable/id-8t2ws property.
- `type`: One of your app’s entity types. For example, specify MyEntity.Type to delete entities with the MyEntity type in the index.

## Discussion

Discussion Use this method to remove only the specified entities from the current index. You might call this method as a precursor to indexing a new set of entity objects. To remove all entities of the specified type, call the deleteAppEntities(ofType:) method instead.

## See Also

### Indexing app entities

- [indexAppEntities(_:priority:)](corespotlight/cssearchableindex/indexappentities(_:priority:).md)
- [deleteAppEntities(ofType:)](corespotlight/cssearchableindex/deleteappentities(oftype:).md)
