Skip to content

Commit 13aed8a

Browse files
committed
update docs
1 parent 2b7a0b4 commit 13aed8a

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

docs/aggregations.asciidoc

+4
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ In addition to the buckets themselves, the bucket aggregations also compute and
140140

141141
* <<date-range-aggregation-usage,Date Range Aggregation Usage>>
142142

143+
* <<diversified-sampler-aggregation-usage,Diversified Sampler Aggregation Usage>>
144+
143145
* <<filter-aggregation-usage,Filter Aggregation Usage>>
144146

145147
* <<filters-aggregation-usage,Filters Aggregation Usage>>
@@ -201,6 +203,8 @@ include::aggregations/bucket/date-histogram/date-histogram-aggregation-usage.asc
201203

202204
include::aggregations/bucket/date-range/date-range-aggregation-usage.asciidoc[]
203205

206+
include::aggregations/bucket/diversified-sampler/diversified-sampler-aggregation-usage.asciidoc[]
207+
204208
include::aggregations/bucket/filter/filter-aggregation-usage.asciidoc[]
205209

206210
include::aggregations/bucket/filters/filters-aggregation-usage.asciidoc[]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
:ref_current: https://www.elastic.co/guide/en/elasticsearch/reference/master
2+
3+
:github: https://github.com/elastic/elasticsearch-net
4+
5+
:nuget: https://www.nuget.org/packages
6+
7+
////
8+
IMPORTANT NOTE
9+
==============
10+
This file has been generated from https://github.com/elastic/elasticsearch-net/tree/master/src/Tests/Tests/Aggregations/Bucket/DiversifiedSampler/DiversifiedSamplerAggregationUsageTests.cs.
11+
If you wish to submit a PR for any spelling mistakes, typos or grammatical errors for this file,
12+
please modify the original csharp file found at the link and submit the PR with that change. Thanks!
13+
////
14+
15+
[[diversified-sampler-aggregation-usage]]
16+
=== Diversified Sampler Aggregation Usage
17+
18+
==== Fluent DSL example
19+
20+
[source,csharp]
21+
----
22+
a => a
23+
.DiversifiedSampler("diversified_sample", sm => sm
24+
.ExecutionHint(DiversifiedSamplerAggregationExecutionHint.GlobalOrdinals)
25+
.Field(doc => doc.Type)
26+
.MaxDocsPerValue(10)
27+
.ShardSize(200)
28+
.Aggregations(aa => aa
29+
.SignificantTerms("significant_names", st => st
30+
.Field(p => p.Name)
31+
)
32+
)
33+
)
34+
----
35+
36+
==== Object Initializer syntax example
37+
38+
[source,csharp]
39+
----
40+
new DiversifiedSamplerAggregation("diversified_sample")
41+
{
42+
ExecutionHint = DiversifiedSamplerAggregationExecutionHint.GlobalOrdinals,
43+
Field = new Field("type"),
44+
MaxDocsPerValue = 10,
45+
ShardSize = 200,
46+
Aggregations = new SignificantTermsAggregation("significant_names")
47+
{
48+
Field = "name"
49+
}
50+
}
51+
----
52+
53+
[source,javascript]
54+
.Example json output
55+
----
56+
{
57+
"diversified_sample": {
58+
"diversified_sampler": {
59+
"execution_hint": "global_ordinals",
60+
"field": "type",
61+
"max_docs_per_value": 10,
62+
"shard_size": 200
63+
},
64+
"aggs": {
65+
"significant_names": {
66+
"significant_terms": {
67+
"field": "name"
68+
}
69+
}
70+
}
71+
}
72+
}
73+
----
74+

0 commit comments

Comments
 (0)