@@ -9,6 +9,24 @@ namespace Nest
99 /// </summary>
1010 public static class DeleteExtensions
1111 {
12+
13+ /// <summary>
14+ ///The delete API allows to delete a typed JSON document from a specific index based on its id.
15+ /// <para> </para>>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html
16+ /// </summary>
17+ /// <typeparam name="T">The type used to infer the default index and typename</typeparam>
18+ /// <param name="client"></param>
19+ /// <param name="index">The name of the index as string</param>
20+ /// <param name="type">The type name of the document you wish to delete</param>
21+ /// <param name="id">The id as string of the document you want to delete</param>
22+ /// <param name="selector">An optional descriptor to further describe the delete operation</param>
23+ public static IDeleteResponse Delete ( this IElasticClient client , string index , string type , string id ,
24+ Func < DeleteDescriptor < object > , DeleteDescriptor < object > > selector = null )
25+ {
26+ selector = selector ?? ( s => s ) ;
27+ return client . Delete < object > ( s => selector ( s . Index ( index ) . Type ( type ) . Id ( id ) ) ) ;
28+ }
29+
1230 /// <summary>
1331 ///The delete API allows to delete a typed JSON document from a specific index based on its id.
1432 /// <para> </para>>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html
@@ -51,6 +69,23 @@ public static Task<IDeleteResponse> DeleteAsync<T>(this IElasticClient client, l
5169 return client . DeleteAsync < T > ( s => selector ( s . Id ( id ) ) ) ;
5270 }
5371
72+ /// <summary>
73+ ///The delete API allows to delete a typed JSON document from a specific index based on its id.
74+ /// <para> </para>>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html
75+ /// </summary>
76+ /// <typeparam name="T">The type used to infer the default index and typename</typeparam>
77+ /// <param name="client"></param>
78+ /// <param name="index">The name of the index as string</param>
79+ /// <param name="type">The type name of the document you wish to delete</param>
80+ /// <param name="id">The id as string of the document you want to delete</param>
81+ /// <param name="selector">An optional descriptor to further describe the delete operation</param>
82+ public static Task < IDeleteResponse > DeleteAsync ( this IElasticClient client ,
83+ string index , string type , string id ,
84+ Func < DeleteDescriptor < object > , DeleteDescriptor < object > > selector = null )
85+ {
86+ selector = selector ?? ( s => s ) ;
87+ return client . DeleteAsync < object > ( s => selector ( s . Index ( index ) . Type ( type ) . Id ( id ) ) ) ;
88+ }
5489 /// <summary>
5590 ///The delete API allows to delete a typed JSON document from a specific index based on its id.
5691 /// <para> </para>>http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-delete.html
0 commit comments