Skip to main content
This page documents an earlier version of the API client. For the latest version, see Delete an index.
Required ACL: deleteIndex
  • Deleting an index doesn’t remove its analytics data.
  • Deleting a nonexistent index is ignored—no error is returned.
  • Indices with replicas:
    • Deleting a primary index makes replicas independent indices.
    • You can’t delete a replica directly. First unlink it to make it a regular index, then delete it.
  • Delete only records. Use clearObjects to remove records but keep settings, rules, and synonyms.
For more information, including how to delete multiple indices, see Delete indices.

Examples

Delete an index by name

// Use an API key with `deleteIndex` ACL
var client = new SearchClient("YourApplicationID", "YourAPIKey");
var index = client.InitIndex("YourIndexName");

index.Delete();

// Asynchronous
await index.DeleteAsync();

Parameters

indexName
string
required
Name of the index to be deleted.

Response

deletedAt
string
Date at which the job to delete the index has been created.
taskID
integer
The taskID for the waitTask method.

Response as JSON

This section shows the JSON response returned by the API. Each API client wraps this response in language-specific objects, so the structure may vary. To view the response, use the getLogs method. Don’t rely on the order of properties—JSON objects don’t preserve key order.
JSON
{
  "deletedAt": "2017-12-18T21:22:40.761Z",
  "taskID": 19541511530
}
I