WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
The delete API allows to delete a typed JSON document from a specific index based on its id. See also deleting by query for other ways to delete data.
Delete with custom parametersedit
client.Delete(1, d => d .Type("users") .Index("myindex") );
Object Initializer Syntaxedit
// Be explicit with type and index client.Delete(new DeleteRequest("myindex", "users", "1")); // Infer type and index from CLR type client.Delete(new DeleteRequest<ElasticsearchProject>("1"));
Id property is inferred (can be any value type (int, string, float …))
Indices and Mappingsedit
See Bulk API