Skip to content

Commit 271685c

Browse files
committed
Merge branch 'JamieLybo-patch-1' into 6.x
2 parents 436e61c + afe62d9 commit 271685c

12 files changed

+36
-31
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
138138
139139
foreach (var item in projectsPerMonth.Buckets)
140140
{
141+
if (item.DocCount == 0) continue;
141142
var stablePercentage = item.BucketScript("stable_percentage");
142143
stablePercentage.Should().NotBeNull();
143144
stablePercentage.Value.Should().HaveValue();

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,15 @@ projectsPerMonth.Should().NotBeNull();
8484
projectsPerMonth.Buckets.Should().NotBeNull();
8585
projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
8686
87+
var notNullDerivativeSeen = 0;
8788
// derivative not calculated for the first bucket
8889
foreach (var item in projectsPerMonth.Buckets.Skip(1))
8990
{
91+
if (item.DocCount == 0) continue;
9092
var commitsDerivative = item.Derivative("commits_derivative");
9193
commitsDerivative.Should().NotBeNull();
92-
commitsDerivative.Value.Should().NotBe(null);
94+
if (commitsDerivative.Value != null) notNullDerivativeSeen++;
9395
}
96+
notNullDerivativeSeen.Should().BeGreaterThan(0, "atleast one bucket should yield a derivative value surely!");
9497
----
9598

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
102102
// average not calculated for the first bucket
103103
foreach (var item in projectsPerMonth.Buckets.Skip(1))
104104
{
105+
if (item.DocCount == 0) continue;
105106
var movingAvg = item.MovingAverage("commits_moving_avg");
106107
movingAvg.Should().NotBeNull();
107108
movingAvg.Value.Should().BeGreaterThan(0);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
103103
// average not calculated for the first bucket
104104
foreach (var item in projectsPerMonth.Buckets.Skip(1))
105105
{
106+
if (item.DocCount == 0) continue;
106107
var movingAvg = item.MovingAverage("commits_moving_avg");
107108
movingAvg.Should().NotBeNull();
108109
movingAvg.Value.Should().BeGreaterThan(0);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
120120
var bucketCount = 0;
121121
foreach (var item in projectsPerMonth.Buckets)
122122
{
123+
if (item.DocCount == 0) continue;
123124
bucketCount++;
124125
125126
var commits = item.Sum("commits");

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
9898
// average not calculated for the first bucket
9999
foreach (var item in projectsPerMonth.Buckets.Skip(1))
100100
{
101+
if (item.DocCount == 0) continue;
101102
var movingAvg = item.MovingAverage("commits_moving_avg");
102103
movingAvg.Should().NotBeNull();
103104
movingAvg.Value.Should().BeGreaterThan(0);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
101101
// average not calculated for the first bucket so movingAvg.Value is expected to be null there
102102
foreach (var item in projectsPerMonth.Buckets.Skip(1))
103103
{
104+
if (item.DocCount == 0) continue;
104105
var movingAvg = item.Sum("commits_moving_avg");
105106
movingAvg.Should().NotBeNull();
106107
movingAvg.Value.Should().BeGreaterThan(0);

docs/aggregations/pipeline/moving-function/moving-function-aggregation-usage.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
105105
// average not calculated for the first bucket
106106
foreach (var item in projectsPerMonth.Buckets.Skip(1))
107107
{
108+
if (item.DocCount == 0) continue;
108109
var movingAvg = item.Sum("commits_moving_avg");
109110
movingAvg.Should().NotBeNull();
110111
movingAvg.Value.Should().BeGreaterThan(0);

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
9191
9292
var differenceCount = 0;
9393
94+
bool atleastOneSecondDifference = false;
9495
foreach (var item in projectsPerMonth.Buckets)
9596
{
9697
differenceCount++;
98+
if (item.DocCount == 0) continue;
9799
var commits = item.Sum("commits");
98100
commits.Should().NotBeNull();
99101
commits.Value.Should().NotBe(null);
@@ -104,11 +106,13 @@ foreach (var item in projectsPerMonth.Buckets)
104106
// only expect values from the 3rd bucket onwards
105107
if (differenceCount <= 2)
106108
secondDifference.Should().BeNull();
107-
else
109+
else if(secondDifference != null)
108110
{
111+
atleastOneSecondDifference = true;
109112
secondDifference.Should().NotBeNull();
110113
secondDifference.Value.Should().NotBe(null);
111114
}
112115
}
116+
atleastOneSecondDifference.Should().BeTrue("second_difference should be returned on one bucket atleast!");
113117
----
114118

docs/client-concepts/connection/configuration-options.asciidoc

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -176,31 +176,25 @@ Reasons for such exceptions could be search parser errors, index missing excepti
176176

177177
The following is a list of available connection configuration options on `ConnectionSettings`:
178178

179-
`DefaultFieldNameInferrer`::
179+
`DefaultDisableIdInference`::
180180

181-
Specify how field names are inferred from POCO property names.
182-
+
183-
By default, NEST camel cases property names e.g. EmailAddress POCO property => "emailAddress" Elasticsearch document field name
181+
`DefaultFieldNameInferrer`::
184182

185183
`DefaultIndex`::
186184

187-
The default index to use when no index is specified.
185+
`DefaultMappingFor`::
188186

189187
`DefaultMappingFor`::
190188

191-
Specify how the mapping is inferred for a given POCO type. Can be used to infer the index, type, and relation names.
189+
Specify how the mapping is inferred for a given CLR type. The mapping can infer the index, type and relation name for a given CLR type.
192190

193191
`DefaultTypeName`::
194192

195-
Sets a default type name to use within Elasticsearch for all CLR types. If `DefaultTypeNameInferrer` is also set, a configured default type name will only be used when `DefaultTypeNameInferrer` returns null or empty. If unset, the default type name for types will be the lowercased CLR type name.
196-
197193
`DefaultTypeNameInferrer`::
198194

199-
Specify how type names are inferred from POCO types. By default, type names are inferred by calling `ToLowerInvariant` on the type's name.
200-
201195
`InferMappingFor`::
202196

203-
Specify how the mapping is inferred for a given POCO type. Can be used to infer the index, type and relation names. The generic version also allows you to set a default id property and control serialization behavior for properties for the POCO. The type of the document.
197+
Specify how the mapping is inferred for a given CLR type. The mapping can infer the index, type, id and relation name for a given CLR type, as well as control serialization behaviour for CLR properties.
204198

205199
:xml-docs: Nest:ConnectionSettingsBase`1
206200

0 commit comments

Comments
 (0)