<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreSpotlight",
  "identifier" : "/documentation/CoreSpotlight/CSSearchableIndex/deleteAppEntities(identifiedBy:ofType:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Spotlight",
      "CoreSpotlight"
    ],
    "preciseIdentifier" : "s:So17CSSearchableIndexC10AppIntentsE06deleteC8Entities12identifiedBy6ofTypeySay2IDQzG_xmtYaKAC13IndexedEntityRzlF"
  },
  "title" : "deleteAppEntities(identifiedBy:ofType:)"
}
-->

# deleteAppEntities(identifiedBy:ofType:)

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

```
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

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:)`](/documentation/CoreSpotlight/CSSearchableIndex/deleteAppEntities(ofType:)) method
instead.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)