- .NET Clients: other versions:
- Introduction
- Building
- Breaking Changes
- Elasticsearch.Net
- NEST
- Core
- Indices
- Cluster
- Search
- Aggregations
- Handling Aggregations
- Avg aggregation
- Cardinality aggregation
- Date Histogram aggregation
- Date Range aggregation
- Extended Stats Aggregation
- Filter aggregation
- Geo Distance aggregation
- Geohash Grid aggregation
- Global aggregation
- Histogram aggregation
- IPv4 Range aggregation
- Max aggregation
- Min aggregation
- Missing aggregation
- Percentiles aggregation
- Percentile Ranks aggregation
- Range aggregation
- Nested aggregation
- Reverse Nested aggregation
- Significant Terms aggregation
- Stats aggregation
- Sum aggregation
- Terms aggregation
- Top Hits aggregation
- Value Count aggregation
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.
Delete API
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Delete API
editThe 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.
By Id
editclient.Delete<ElasticSearchProject>(1); client.DeleteAsync<ElasticSearchProject>(1);
Delete with custom parameters
editFluent Syntax
editclient.Delete(1, d => d .Type("users") .Index("myindex") );
Object Initializer Syntax
edit// 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"));
By object
editId property is inferred (can be any value type (int, string, float …))
client.Delete(searchProject); client.DeleteAsync(searchProject);
By IEnumerable<T>
editclient.DeleteMany(searchProjects); client.DeleteManyAsync(searchProjects);
By Query
editIndices and Mappings
editSee Delete Mapping and Delete Index
Bulk delete
editSee Bulk API
On this page
Was this helpful?
Thank you for your feedback.