Skip to content

Commit e434ce9

Browse files
committed
Generate updated documentation
This commit updates the generated documentation for the client, to include 7.4 changes.
1 parent 063aa1e commit e434ce9

File tree

56 files changed

+6873
-6603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+6873
-6603
lines changed

docs/aggregations.asciidoc

Lines changed: 118 additions & 114 deletions
Large diffs are not rendered by default.

docs/aggregations/bucket/parent/parent-aggregation-usage.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ new ParentAggregation("name_of_parent_agg", typeof(CommitActivity)) <1>
4747
}
4848
----
4949
<1> `join` field is determined from the _child_ type. In this example, it is `CommitActivity`
50+
5051
<2> sub-aggregations are on the type determined from the `join` field. In this example, a `Project` is a parent of `CommitActivity`
5152

5253
[source,javascript]

docs/aggregations/bucket/terms/terms-aggregation-usage.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ new TermsAggregation("states")
206206
[source,csharp]
207207
----
208208
response.ShouldBeValid();
209-
var states = response.Aggregations.Terms("states");
209+
var states = response.Aggregations.Terms<StateOfBeing>("states");
210210
states.Should().NotBeNull();
211211
states.DocCountErrorUpperBound.Should().HaveValue();
212212
states.SumOtherDocCount.Should().HaveValue();
213213
states.Buckets.Should().NotBeNull();
214214
states.Buckets.Count.Should().BeGreaterThan(0);
215215
foreach (var item in states.Buckets)
216216
{
217-
item.Key.Should().NotBeNullOrEmpty();
217+
item.Key.Should().BeOfType<StateOfBeing>();
218218
item.DocCount.Should().BeGreaterOrEqualTo(1);
219219
}
220220
states.Meta.Should().NotBeNull().And.HaveCount(1);

docs/aggregations/pipeline/bucket-script/bucket-script-aggregation-usage.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ a => a
2323
.DateHistogram("projects_started_per_month", dh => dh
2424
.Field(p => p.StartedOn)
2525
.Interval(DateInterval.Month)
26+
.MinimumDocumentCount(1)
2627
.Aggregations(aa => aa
2728
.Sum("commits", sm => sm
2829
.Field(p => p.NumberOfCommits)
@@ -56,6 +57,7 @@ new DateHistogramAggregation("projects_started_per_month")
5657
{
5758
Field = "startedOn",
5859
Interval = DateInterval.Month,
60+
MinimumDocumentCount = 1,
5961
Aggregations =
6062
new SumAggregation("commits", "numberOfCommits") &&
6163
new FilterAggregation("stable_state")
@@ -85,7 +87,8 @@ new DateHistogramAggregation("projects_started_per_month")
8587
"projects_started_per_month": {
8688
"date_histogram": {
8789
"field": "startedOn",
88-
"interval": "month"
90+
"interval": "month",
91+
"min_doc_count": 1
8992
},
9093
"aggs": {
9194
"commits": {
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
:ref_current: https://www.elastic.co/guide/en/elasticsearch/reference/7.4
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/7.x/src/Tests/Tests/Aggregations/Pipeline/CumulativeCardinality/CumulativeCardinalityAggregationUsageTests.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+
[[cumulative-cardinality-aggregation-usage]]
16+
=== Cumulative Cardinality Aggregation Usage
17+
18+
==== Fluent DSL example
19+
20+
[source,csharp]
21+
----
22+
a => a
23+
.DateHistogram("projects_started_per_month", dh => dh
24+
.Field(p => p.StartedOn)
25+
.CalendarInterval(DateInterval.Month)
26+
.Aggregations(aa => aa
27+
.Cardinality("commits", sm => sm
28+
.Field(p => p.NumberOfCommits)
29+
)
30+
.CumulativeCardinality("cumulative_commits", d => d
31+
.BucketsPath("commits")
32+
)
33+
)
34+
)
35+
----
36+
37+
==== Object Initializer syntax example
38+
39+
[source,csharp]
40+
----
41+
new DateHistogramAggregation("projects_started_per_month")
42+
{
43+
Field = "startedOn",
44+
CalendarInterval = DateInterval.Month,
45+
Aggregations =
46+
new CardinalityAggregation("commits", "numberOfCommits") &&
47+
new CumulativeCardinalityAggregation("cumulative_commits", "commits")
48+
}
49+
----
50+
51+
[source,javascript]
52+
.Example json output
53+
----
54+
{
55+
"projects_started_per_month": {
56+
"date_histogram": {
57+
"field": "startedOn",
58+
"calendar_interval": "month"
59+
},
60+
"aggs": {
61+
"commits": {
62+
"cardinality": {
63+
"field": "numberOfCommits"
64+
}
65+
},
66+
"cumulative_commits": {
67+
"cumulative_cardinality": {
68+
"buckets_path": "commits"
69+
}
70+
}
71+
}
72+
}
73+
}
74+
----
75+
76+
==== Handling Responses
77+
78+
[source,csharp]
79+
----
80+
response.ShouldBeValid();
81+
82+
var projectsPerMonth = response.Aggregations.DateHistogram("projects_started_per_month");
83+
projectsPerMonth.Should().NotBeNull();
84+
projectsPerMonth.Buckets.Should().NotBeNull();
85+
projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
86+
87+
foreach (var item in projectsPerMonth.Buckets)
88+
{
89+
var commitsDerivative = item.CumulativeCardinality("cumulative_commits");
90+
commitsDerivative.Should().NotBeNull();
91+
commitsDerivative.Value.Should().NotBe(null);
92+
}
93+
----
94+

docs/aggregations/pipeline/cumulative-sum/cumulative-sum-aggregation-usage.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
8686
8787
foreach (var item in projectsPerMonth.Buckets)
8888
{
89-
var commitsDerivative = item.Derivative("cumulative_commits");
89+
var commitsDerivative = item.CumulativeSum("cumulative_commits");
9090
commitsDerivative.Should().NotBeNull();
9191
commitsDerivative.Value.Should().NotBe(null);
9292
}

docs/aggregations/pipeline/derivative/derivative-aggregation-usage.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ a => a
2323
.DateHistogram("projects_started_per_month", dh => dh
2424
.Field(p => p.StartedOn)
2525
.Interval(DateInterval.Month)
26+
.MinimumDocumentCount(1)
2627
.Aggregations(aa => aa
2728
.Sum("commits", sm => sm
2829
.Field(p => p.NumberOfCommits)
@@ -42,6 +43,7 @@ new DateHistogramAggregation("projects_started_per_month")
4243
{
4344
Field = "startedOn",
4445
Interval = DateInterval.Month,
46+
MinimumDocumentCount = 1,
4547
Aggregations =
4648
new SumAggregation("commits", "numberOfCommits") &&
4749
new DerivativeAggregation("commits_derivative", "commits")
@@ -55,7 +57,8 @@ new DateHistogramAggregation("projects_started_per_month")
5557
"projects_started_per_month": {
5658
"date_histogram": {
5759
"field": "startedOn",
58-
"interval": "month"
60+
"interval": "month",
61+
"min_doc_count": 1
5962
},
6063
"aggs": {
6164
"commits": {

docs/aggregations/pipeline/moving-average/moving-average-ewma-aggregation-usage.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ a => a
2323
.DateHistogram("projects_started_per_month", dh => dh
2424
.Field(p => p.StartedOn)
2525
.Interval(DateInterval.Month)
26+
.MinimumDocumentCount(1)
2627
.Aggregations(aa => aa
2728
.Sum("commits", sm => sm
2829
.Field(p => p.NumberOfCommits)
@@ -47,6 +48,7 @@ new DateHistogramAggregation("projects_started_per_month")
4748
{
4849
Field = "startedOn",
4950
Interval = DateInterval.Month,
51+
MinimumDocumentCount = 1,
5052
Aggregations =
5153
new SumAggregation("commits", "numberOfCommits")
5254
&& new MovingAverageAggregation("commits_moving_avg", "commits")
@@ -66,7 +68,8 @@ new DateHistogramAggregation("projects_started_per_month")
6668
"projects_started_per_month": {
6769
"date_histogram": {
6870
"field": "startedOn",
69-
"interval": "month"
71+
"interval": "month",
72+
"min_doc_count": 1
7073
},
7174
"aggs": {
7275
"commits": {

docs/aggregations/pipeline/moving-average/moving-average-holt-linear-aggregation-usage.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ a => a
2323
.DateHistogram("projects_started_per_month", dh => dh
2424
.Field(p => p.StartedOn)
2525
.Interval(DateInterval.Month)
26+
.MinimumDocumentCount(1)
2627
.Aggregations(aa => aa
2728
.Sum("commits", sm => sm.Field(p => p.NumberOfCommits))
2829
.MovingAverage("commits_moving_avg", mv => mv
@@ -46,6 +47,7 @@ new DateHistogramAggregation("projects_started_per_month")
4647
{
4748
Field = "startedOn",
4849
Interval = DateInterval.Month,
50+
MinimumDocumentCount = 1,
4951
Aggregations =
5052
new SumAggregation("commits", "numberOfCommits")
5153
&& new MovingAverageAggregation("commits_moving_avg", "commits")
@@ -66,7 +68,8 @@ new DateHistogramAggregation("projects_started_per_month")
6668
"projects_started_per_month": {
6769
"date_histogram": {
6870
"field": "startedOn",
69-
"interval": "month"
71+
"interval": "month",
72+
"min_doc_count": 1
7073
},
7174
"aggs": {
7275
"commits": {

docs/aggregations/pipeline/moving-average/moving-average-holt-winters-aggregation-usage.asciidoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ a => a
2323
.DateHistogram("projects_started_per_month", dh => dh
2424
.Field(p => p.StartedOn)
2525
.Interval(DateInterval.Month)
26+
.MinimumDocumentCount(1)
2627
.Aggregations(aa => aa
2728
.Sum("commits", sm => sm
2829
.Field(p => p.NumberOfCommits)
@@ -53,6 +54,7 @@ new DateHistogramAggregation("projects_started_per_month")
5354
{
5455
Field = "startedOn",
5556
Interval = DateInterval.Month,
57+
MinimumDocumentCount = 1,
5658
Aggregations =
5759
new SumAggregation("commits", "numberOfCommits")
5860
&& new MovingAverageAggregation("commits_moving_avg", "commits")
@@ -78,7 +80,8 @@ new DateHistogramAggregation("projects_started_per_month")
7880
"projects_started_per_month": {
7981
"date_histogram": {
8082
"field": "startedOn",
81-
"interval": "month"
83+
"interval": "month",
84+
"min_doc_count": 1
8285
},
8386
"aggs": {
8487
"commits": {
@@ -129,7 +132,7 @@ foreach (var item in projectsPerMonth.Buckets)
129132
var movingAverage = item.MovingAverage("commits_moving_avg");
130133
131134
// Moving Average specifies a window of 4 so
132-
// moving average values should exist from 5th bucketr onwards
135+
// moving average values should exist from 5th bucket onwards
133136
if (bucketCount <= 4)
134137
movingAverage.Should().BeNull();
135138
else

docs/aggregations/pipeline/moving-average/moving-average-simple-aggregation-usage.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ a => a
3131
.BucketsPath("commits")
3232
.Window(30)
3333
.Predict(10)
34+
.GapPolicy(GapPolicy.InsertZeros)
3435
.Model(m => m
3536
.Simple()
3637
)
@@ -53,6 +54,7 @@ new DateHistogramAggregation("projects_started_per_month")
5354
{
5455
Window = 30,
5556
Predict = 10,
57+
GapPolicy = GapPolicy.InsertZeros,
5658
Model = new SimpleModel()
5759
}
5860
}
@@ -79,6 +81,7 @@ new DateHistogramAggregation("projects_started_per_month")
7981
"model": "simple",
8082
"window": 30,
8183
"predict": 10,
84+
"gap_policy": "insert_zeros",
8285
"settings": {}
8386
}
8487
}

docs/aggregations/pipeline/serial-differencing/serial-differencing-aggregation-usage.asciidoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ a => a
2323
.DateHistogram("projects_started_per_month", dh => dh
2424
.Field(p => p.StartedOn)
2525
.Interval(DateInterval.Month)
26+
.MinimumDocumentCount(1)
2627
.Aggregations(aa => aa
2728
.Sum("commits", sm => sm
2829
.Field(p => p.NumberOfCommits)
@@ -43,6 +44,7 @@ new DateHistogramAggregation("projects_started_per_month")
4344
{
4445
Field = "startedOn",
4546
Interval = DateInterval.Month,
47+
MinimumDocumentCount = 1,
4648
Aggregations =
4749
new SumAggregation("commits", "numberOfCommits")
4850
&& new SerialDifferencingAggregation("second_difference", "commits")
@@ -59,7 +61,8 @@ new DateHistogramAggregation("projects_started_per_month")
5961
"projects_started_per_month": {
6062
"date_histogram": {
6163
"field": "startedOn",
62-
"interval": "month"
64+
"interval": "month",
65+
"min_doc_count": 1
6366
},
6467
"aggs": {
6568
"commits": {

docs/aggregations/writing-aggregations.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ return s => s
232232
);
233233
----
234234
<1> a list of aggregation functions to apply
235+
235236
<2> Using LINQ's `Aggregate()` function to accumulate/apply all of the aggregation functions
236237

237238
[[handling-aggregate-response]]
@@ -275,5 +276,6 @@ var maxPerChild = childAggregation.Max("max_per_child");
275276
maxPerChild.Should().NotBeNull(); <2>
276277
----
277278
<1> Do something with the average per child. Here we just assert it's not null
279+
278280
<2> Do something with the max per child. Here we just assert it's not null
279281

0 commit comments

Comments
 (0)