File tree Expand file tree Collapse file tree 2 files changed +42
-8
lines changed Expand file tree Collapse file tree 2 files changed +42
-8
lines changed Original file line number Diff line number Diff line change @@ -13,25 +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"))
16+ .Indices(new[] {"index1", "index2"})
17+ .Query(rq => rq.Term(f => f.Name, "elasticsearch.pm"))
1818 );
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"))
25+ .AllIndices()
26+ .Query(rq => rq.Term(f => f.Name, "elasticsearch.pm"))
2727 );
2828
2929The DeleteByQuery can be further controlled by passing a ` DeleteByQueryParameters ` object
3030
3131 ConnectedClient.DeleteByQuery<ElasticSearchProject>(q => q
32- .Query(rq => rq
33- .Term(f => f.Name, "elasticsearch.pm"))
34- .Routing("nest")
35- .Replication(ReplicationOptions.Sync)
32+ .Query(rq => rq
33+ .Term(f => f.Name, "elasticsearch.pm"))
34+ .Routing("nest")
35+ .Replication(ReplicationOptions.Sync)
3636 );
3737
Original file line number Diff line number Diff line change 1+ ---
2+ template : layout.jade
3+ title : Connecting
4+ menusection : search
5+ menuitem : aggregation
6+ ---
7+
8+
9+ # Aggregations
10+
11+ Aggregations is new and more powerfull way to build facets. Using them its possible to build any kind of facets and grouped in way as needed.
12+
13+ ## Simple query
14+
15+ var results = EClinet.Search<ElasticSearchObject>(s => s.QueryString("*")
16+ .Aggregations(a => a.Terms("GroupName", ta => ta.Field("Category")))
17+ );
18+
19+ then to read items
20+
21+ var termBucket = results.Aggs.Terms("GroupName").Items;
22+
23+ ## Global
24+
25+ var results = EClinet.Search<ElasticSearchObject>(s => s.QueryString("*")
26+ .Aggregations(a => a.Global("Title", g=>g.Aggregations(ga => ga.Terms("GroupName", ta => ta.Field("Category"))))
27+ ));
28+
29+ ##Sub aggregation
30+
31+ var results = EClinet.Search<ElasticSearchObject>(s => s.QueryString("*")
32+ .Aggregations(a => a.Global("Title", g=>g.Aggregations(ga => ga.Terms("GroupName", ta => ta.Field("Category")
33+ .Aggregations(sa=>sa.Terms("Color", sat=>sat.Field("Color")))
34+ )))));
You can’t perform that action at this time.
0 commit comments