File tree Expand file tree Collapse file tree 3 files changed +28
-23
lines changed
new_docs/contents/nest/core Expand file tree Collapse file tree 3 files changed +28
-23
lines changed Original file line number Diff line number Diff line change @@ -13,24 +13,25 @@ menuitem: delete-by-query
1313Elasticsearch allows you to delete over multiple types and indexes, so does NEST.
1414
1515 ConnectedClient.DeleteByQuery<ElasticSearchProject>(q => q
16- .Indices(new[] {"index1", "index2"})
17- .Query(rq => rq.Term(f => f.Name, "elasticsearch.pm"))
18- );
16+ .Indices(new[] {"index1", "index2"})
17+ .Query(rq => rq.Term(f => f.Name, "elasticsearch.pm"))
18+ );
1919
2020As always ` *Async ` variants are available too.
2121
2222You can also delete by query over all the indices and types:
2323
2424 ConnectedClient.DeleteByQuery<ElasticSearchProject>(q => q
25- .AllIndices()
26- .Query(rq => rq.Term(f => f.Name, "elasticsearch.pm"))
27- );
25+ .AllIndices()
26+ .Query(rq => rq.Term(f => f.Name, "elasticsearch.pm"))
27+ );
2828
2929The DeleteByQuery can be further controlled by passing a ` DeleteByQueryParameters ` object
3030
31- ConnectedClient.DeleteByQuery<object>(
32- q => q.Query(rq => rq
33- .Term(f => f.Name, "elasticsearch.pm"))
34- .Routing("nest")
35- .Replication(ReplicationOptions.Sync)
31+ ConnectedClient.DeleteByQuery<ElasticSearchProject>(q => q
32+ .Query(rq => rq
33+ .Term(f => f.Name, "elasticsearch.pm"))
34+ .Routing("nest")
35+ .Replication(ReplicationOptions.Sync)
36+ );
3637
Original file line number Diff line number Diff line change @@ -13,25 +13,27 @@ The delete API allows to delete a typed JSON document from a specific index base
1313
1414## By Id
1515
16- this.ConnectedClient.Delete<ElasticSearchProject>(searchProject.Id);
17- this.ConnectedClient.DeleteAsync<ElasticSearchProject>(searchProject.Id);
16+ this.ConnectedClient.Delete<ElasticSearchProject>(searchProject.Id);
17+ this.ConnectedClient.DeleteAsync<ElasticSearchProject>(searchProject.Id);
1818
1919## Delete with custom parameters
20- IDeleteResponse result = _client.Delete(request.Id, descriptor => descriptor
21- .Type("users")
22- .Index("myindex"));
20+
21+ _client.Delete(request.Id, s => s
22+ .Type("users")
23+ .Index("myindex")
24+ );
2325
2426## By object (T)
2527
2628Id property is inferred (can be any value type (int, string, float ...))
2729
28- this.ConnectedClient.Delete(searchProject);
29- this.ConnectedClient.DeleteAsync(searchProject);
30+ this.ConnectedClient.Delete(searchProject);
31+ this.ConnectedClient.DeleteAsync(searchProject);
3032
3133## By IEnumerable<T >
3234
33- this.ConnectedClient.DeleteMany(searchProjects);
34- this.ConnectedClient.DeleteManyAsync(searchProjects);
35+ this.ConnectedClient.DeleteMany(searchProjects);
36+ this.ConnectedClient.DeleteManyAsync(searchProjects);
3537
3638## By IEnumerable<T > using bulkparameters
3739
Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ is sufficient. this will index post too `/[default index]/posts/12`. The typenam
2121
2222If you need more control there are plenty of overloads, i.e:
2323
24- IIndexResponse result = _client.Index(post, i => i.Index(index)
25- .Type(type)
26- .Id(post.Id));
24+ _client.Index(post, i => i
25+ .Index(index)
26+ .Type(type)
27+ .Id(post.Id)
28+ );
2729
2830## Asynchronous
2931
You can’t perform that action at this time.
0 commit comments