Skip to content

Commit 4c2e1e7

Browse files
committed
Bump to 5.6.6 for release
1 parent bce26f7 commit 4c2e1e7

File tree

114 files changed

+590
-654
lines changed

Some content is hidden

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

114 files changed

+590
-654
lines changed

docs/aggregations/aggregation-meta-usage.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ new SearchRequest<Project>()
4444
Size = 0,
4545
Aggregations = new MinAggregation("min_last_activity", Infer.Field<Project>(p => p.LastActivity))
4646
{
47-
Meta = new Dictionary<string,object>
47+
Meta = new Dictionary<string, object>
4848
{
4949
{ "meta_1", "value_1" },
5050
{ "meta_2", 2 },

docs/aggregations/bucket/adjacency-matrix/adjacency-matrix-usage.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ s => s
3838
----
3939
new SearchRequest<Project>
4040
{
41-
Size = 0,
41+
Size = 0,
4242
Aggregations = new AdjacencyMatrixAggregation("interactions")
4343
{
4444
Filters = new NamedFiltersContainer

docs/aggregations/bucket/date-range/date-range-aggregation-usage.asciidoc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ new SearchRequest<Project>
5555
Field = Field<Project>(p => p.StartedOn),
5656
Ranges = new List<DateRangeExpression>
5757
{
58-
new DateRangeExpression { From = DateMath.Anchored(FixedDate).Add("2d"), To = DateMath.Now},
58+
new DateRangeExpression { From = DateMath.Anchored(FixedDate).Add("2d"), To = DateMath.Now },
5959
new DateRangeExpression { To = DateMath.Now.Add(TimeSpan.FromDays(1)).Subtract("30m").RoundTo(TimeUnit.Hour) },
6060
new DateRangeExpression { From = DateMath.Anchored("2012-05-05").Add(TimeSpan.FromDays(1)).Subtract("1m") }
6161
},
@@ -119,9 +119,6 @@ We specified three ranges so we expect to have three of them in the response
119119
[source,csharp]
120120
----
121121
dateHistogram.Buckets.Count.Should().Be(3);
122-
foreach (var item in dateHistogram.Buckets)
123-
{
124-
item.DocCount.Should().BeGreaterThan(0);
125-
}
122+
foreach (var item in dateHistogram.Buckets) item.DocCount.Should().BeGreaterThan(0);
126123
----
127124

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ new SearchRequest<Project>
4343
{
4444
Aggregations = new FilterAggregation("bethels_projects")
4545
{
46-
Filter = new TermQuery {Field = Field<Project>(p => p.LeadDeveloper.FirstName), Value = FirstNameToFind},
46+
Filter = new TermQuery { Field = Field<Project>(p => p.LeadDeveloper.FirstName), Value = FirstNameToFind },
4747
Aggregations =
4848
new TermsAggregation("project_tags") { Field = Field<Project>(p => p.CuratedTags.First().Name.Suffix("keyword")) }
4949
}

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ new SearchRequest<Project>
5757
OtherBucketKey = "other_states_of_being",
5858
Filters = new NamedFiltersContainer
5959
{
60-
{ "belly_up", Query<Project>.Term(p=>p.State, StateOfBeing.BellyUp) },
61-
{ "stable", Query<Project>.Term(p=>p.State, StateOfBeing.Stable) },
62-
{ "very_active", Query<Project>.Term(p=>p.State, StateOfBeing.VeryActive) }
60+
{ "belly_up", Query<Project>.Term(p => p.State, StateOfBeing.BellyUp) },
61+
{ "stable", Query<Project>.Term(p => p.State, StateOfBeing.Stable) },
62+
{ "very_active", Query<Project>.Term(p => p.State, StateOfBeing.VeryActive) }
6363
},
6464
Aggregations =
6565
new TermsAggregation("project_tags") { Field = Field<Project>(p => p.CuratedTags.First().Name.Suffix("keyword")) }
@@ -175,9 +175,9 @@ new SearchRequest<Project>
175175
OtherBucket = true,
176176
Filters = new List<QueryContainer>
177177
{
178-
Query<Project>.Term(p=>p.State, StateOfBeing.BellyUp) ,
179-
Query<Project>.Term(p=>p.State, StateOfBeing.Stable) ,
180-
Query<Project>.Term(p=>p.State, StateOfBeing.VeryActive)
178+
Query<Project>.Term(p => p.State, StateOfBeing.BellyUp),
179+
Query<Project>.Term(p => p.State, StateOfBeing.Stable),
180+
Query<Project>.Term(p => p.State, StateOfBeing.VeryActive)
181181
},
182182
Aggregations =
183183
new TermsAggregation("project_tags") { Field = Field<Project>(p => p.CuratedTags.First().Name.Suffix("keyword")) }
@@ -243,10 +243,7 @@ filterAgg.Should().NotBeNull();
243243
var results = filterAgg.AnonymousBuckets();
244244
results.Count.Should().Be(4);
245245
246-
foreach (var singleBucket in results.Take(3))
247-
{
248-
singleBucket.DocCount.Should().BeGreaterThan(0);
249-
}
246+
foreach (var singleBucket in results.Take(3)) singleBucket.DocCount.Should().BeGreaterThan(0);
250247
251248
results.Last().DocCount.Should().Be(0); <1>
252249
----

docs/aggregations/bucket/ip-range/ip-range-aggregation-usage.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ new SearchRequest<Project>
4040
Field = Field((Project p) => p.LeadDeveloper.IPAddress),
4141
Ranges = new List<Nest.IpRange>
4242
{
43-
new Nest.IpRange {To = "127.0.0.1"},
44-
new Nest.IpRange {From = "127.0.0.1"}
43+
new Nest.IpRange { To = "127.0.0.1" },
44+
new Nest.IpRange { From = "127.0.0.1" }
4545
}
4646
}
4747
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ var tags = response.Aggs.Nested("tags");
7979
tags.Should().NotBeNull();
8080
var tagNames = tags.Terms("tag_names");
8181
tagNames.Should().NotBeNull();
82-
foreach(var item in tagNames.Buckets)
82+
foreach (var item in tagNames.Buckets)
8383
{
8484
item.Key.Should().NotBeNullOrEmpty();
8585
item.DocCount.Should().BeGreaterThan(0);

docs/aggregations/bucket/reverse-nested/reverse-nested-aggregation-usage.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ var tags = response.Aggs.Nested("tags");
107107
tags.Should().NotBeNull();
108108
var tagNames = tags.Terms("tag_names");
109109
tagNames.Should().NotBeNull();
110-
foreach(var tagName in tagNames.Buckets)
110+
foreach (var tagName in tagNames.Buckets)
111111
{
112112
tagName.Key.Should().NotBeNullOrEmpty();
113113
tagName.DocCount.Should().BeGreaterThan(0);
114114
var tagsToProjects = tagName.ReverseNested("tags_to_project");
115115
tagsToProjects.Should().NotBeNull();
116116
var topProjectsPerTag = tagsToProjects.Terms("top_projects_per_tag");
117117
topProjectsPerTag.Should().NotBeNull();
118-
foreach(var topProject in topProjectsPerTag.Buckets)
118+
foreach (var topProject in topProjectsPerTag.Buckets)
119119
{
120120
topProject.Key.Should().NotBeNullOrEmpty();
121121
topProject.DocCount.Should().BeGreaterThan(0);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ s => s
185185
.BackgroundIsSuperSet()
186186
.IncludeNegatives()
187187
)
188-
.Exclude(new [] { "pierce" })
188+
.Exclude(new[] { "pierce" })
189189
)
190190
)
191191
----

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ new SearchRequest<Project>
5858
ShardSize = 100,
5959
ExecutionHint = TermsAggregationExecutionHint.Map,
6060
Missing = "n/a",
61-
Script = new InlineScript("'State of Being: '+_value") {Lang = "groovy"},
61+
Script = new InlineScript("'State of Being: '+_value") { Lang = "groovy" },
6262
Order = new List<TermsOrder>
6363
{
6464
TermsOrder.TermAscending,
6565
TermsOrder.CountDescending
6666
},
6767
Meta = new Dictionary<string, object>
6868
{
69-
{"foo", "bar"}
69+
{ "foo", "bar" }
7070
}
7171
}
7272
}
@@ -172,15 +172,15 @@ new SearchRequest<Project>
172172
ShardSize = 100,
173173
ExecutionHint = TermsAggregationExecutionHint.Map,
174174
Missing = "n/a",
175-
Include = new TermsIncludeExclude {Pattern = "(Stable|VeryActive)"},
175+
Include = new TermsIncludeExclude { Pattern = "(Stable|VeryActive)" },
176176
Order = new List<TermsOrder>
177177
{
178178
TermsOrder.TermAscending,
179179
TermsOrder.CountDescending
180180
},
181181
Meta = new Dictionary<string, object>
182182
{
183-
{"foo", "bar"}
183+
{ "foo", "bar" }
184184
}
185185
}
186186
}
@@ -258,7 +258,7 @@ s => s
258258
.ShardSize(100)
259259
.ExecutionHint(TermsAggregationExecutionHint.Map)
260260
.Missing("n/a")
261-
.Include(new[] {StateOfBeing.Stable.ToString(), StateOfBeing.VeryActive.ToString()})
261+
.Include(new[] { StateOfBeing.Stable.ToString(), StateOfBeing.VeryActive.ToString() })
262262
.Order(TermsOrder.TermAscending)
263263
.Order(TermsOrder.CountDescending)
264264
.Meta(m => m
@@ -283,15 +283,15 @@ new SearchRequest<Project>
283283
ShardSize = 100,
284284
ExecutionHint = TermsAggregationExecutionHint.Map,
285285
Missing = "n/a",
286-
Include = new TermsIncludeExclude {Values = new[] {StateOfBeing.Stable.ToString(), StateOfBeing.VeryActive.ToString()}},
286+
Include = new TermsIncludeExclude { Values = new[] { StateOfBeing.Stable.ToString(), StateOfBeing.VeryActive.ToString() } },
287287
Order = new List<TermsOrder>
288288
{
289289
TermsOrder.TermAscending,
290290
TermsOrder.CountDescending
291291
},
292292
Meta = new Dictionary<string, object>
293293
{
294-
{"foo", "bar"}
294+
{ "foo", "bar" }
295295
}
296296
}
297297
}
@@ -373,7 +373,7 @@ s => s
373373
.Aggregations(a => a
374374
.Terms("commits", st => st
375375
.Field(p => p.NumberOfCommits)
376-
.Include(partition: 0, numberOfPartitions: 10)
376+
.Include(0, 10)
377377
.Size(5)
378378
)
379379
)
@@ -388,7 +388,7 @@ new SearchRequest<Project>
388388
Size = 0,
389389
Aggregations = new TermsAggregation("commits")
390390
{
391-
Field = Infer.Field<Project>(p => p.NumberOfCommits),
391+
Field = Field<Project>(p => p.NumberOfCommits),
392392
Include = new TermsIncludeExclude
393393
{
394394
Partition = 0,

docs/aggregations/metric/average/average-aggregation-usage.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ s => s
2727
)
2828
.Field(p => p.NumberOfCommits)
2929
.Missing(10)
30-
.Script(ss=>ss.Inline("_value * 1.2").Lang("groovy"))
30+
.Script(ss => ss.Inline("_value * 1.2").Lang("groovy"))
3131
)
3232
)
3333
----

docs/aggregations/metric/scripted-metric/scripted-metric-aggregation-usage.asciidoc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ new SearchRequest<Project>
3838
{
3939
Aggregations = new ScriptedMetricAggregation("sum_the_hard_way")
4040
{
41-
InitScript = new InlineScript("_agg['commits'] = []") {Lang = "groovy"},
42-
MapScript = new InlineScript("if (doc['state'].value == \"Stable\") { _agg.commits.add(doc['numberOfCommits']) }") {Lang = "groovy"},
43-
CombineScript = new InlineScript("sum = 0; for (c in _agg.commits) { sum += c }; return sum") {Lang = "groovy"},
44-
ReduceScript = new InlineScript("sum = 0; for (a in _aggs) { sum += a }; return sum") {Lang = "groovy"}
41+
InitScript = new InlineScript("_agg['commits'] = []") { Lang = "groovy" },
42+
MapScript = new InlineScript("if (doc['state'].value == \"Stable\") { _agg.commits.add(doc['numberOfCommits']) }")
43+
{ Lang = "groovy" },
44+
CombineScript = new InlineScript("sum = 0; for (c in _agg.commits) { sum += c }; return sum") { Lang = "groovy" },
45+
ReduceScript = new InlineScript("sum = 0; for (a in _aggs) { sum += a }; return sum") { Lang = "groovy" }
4546
}
4647
}
4748
----
@@ -114,16 +115,16 @@ new SearchRequest<Project>
114115
Aggregations =
115116
new ScriptedMetricAggregation("by_state_total")
116117
{
117-
InitScript = new InlineScript(First.Init) {Lang = First.Language},
118-
MapScript = new InlineScript(First.Map) {Lang = First.Language},
119-
ReduceScript = new InlineScript(First.Reduce) {Lang = First.Language}
118+
InitScript = new InlineScript(First.Init) { Lang = First.Language },
119+
MapScript = new InlineScript(First.Map) { Lang = First.Language },
120+
ReduceScript = new InlineScript(First.Reduce) { Lang = First.Language }
120121
} &&
121122
new ScriptedMetricAggregation("total_commits")
122123
{
123-
InitScript = new InlineScript(Second.Init) {Lang = Second.Language},
124-
MapScript = new InlineScript(Second.Map) {Lang = Second.Language},
125-
CombineScript = new InlineScript(Second.Combine) {Lang = Second.Language},
126-
ReduceScript = new InlineScript(Second.Reduce) {Lang = Second.Language}
124+
InitScript = new InlineScript(Second.Init) { Lang = Second.Language },
125+
MapScript = new InlineScript(Second.Map) { Lang = Second.Language },
126+
CombineScript = new InlineScript(Second.Combine) { Lang = Second.Language },
127+
ReduceScript = new InlineScript(Second.Reduce) { Lang = Second.Language }
127128
}
128129
}
129130
----

docs/aggregations/metric/top-hits/top-hits-aggregation-usage.asciidoc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,31 +100,32 @@ new SearchRequest<Project>
100100
},
101101
Source = new SourceFilter
102102
{
103-
Includes = new [] { "name", "lastActivity" }
103+
Includes = new[] { "name", "lastActivity" }
104104
},
105105
Size = 1,
106106
Version = true,
107107
TrackScores = true,
108108
Explain = true,
109-
FielddataFields = new [] { "state", "numberOfCommits" },
109+
FielddataFields = new[] { "state", "numberOfCommits" },
110110
StoredFields = new[] { "startedOn" },
111111
Highlight = new Highlight
112112
{
113-
Fields = new Dictionary<Nest.Field, IHighlightField>
113+
Fields = new Dictionary<Field, IHighlightField>
114114
{
115115
{ Field<Project>(p => p.Tags), new HighlightField() },
116116
{ Field<Project>(p => p.Description), new HighlightField() }
117117
}
118118
},
119119
ScriptFields = new ScriptFields
120120
{
121-
{ "commit_factor", new ScriptField
121+
{
122+
"commit_factor", new ScriptField
122123
{
123124
Script = new InlineScript("doc['numberOfCommits'].value * 2") { Lang = "groovy" }
124125
}
125126
}
126127
},
127-
DocValueFields = Infer.Fields<Project>(f => f.State)
128+
DocValueFields = Fields<Project>(f => f.State)
128129
}
129130
}
130131
}
@@ -209,7 +210,7 @@ response.ShouldBeValid();
209210
var states = response.Aggs.Terms("states");
210211
states.Should().NotBeNull();
211212
states.Buckets.Should().NotBeNullOrEmpty();
212-
foreach(var state in states.Buckets)
213+
foreach (var state in states.Buckets)
213214
{
214215
state.Key.Should().NotBeNullOrEmpty();
215216
state.DocCount.Should().BeGreaterThan(0);
@@ -226,8 +227,8 @@ foreach(var state in states.Buckets)
226227
hits.All(h => h.Fields.ValuesOf<DateTime>("startedOn").Any()).Should().BeTrue();
227228
var projects = topStateHits.Documents<Project>();
228229
projects.Should().NotBeEmpty();
229-
projects.Should().OnlyContain(p=>!string.IsNullOrWhiteSpace(p.Name), "source filter included name");
230-
projects.Should().OnlyContain(p=>string.IsNullOrWhiteSpace(p.Description), "source filter does NOT include description");
230+
projects.Should().OnlyContain(p => !string.IsNullOrWhiteSpace(p.Name), "source filter included name");
231+
projects.Should().OnlyContain(p => string.IsNullOrWhiteSpace(p.Description), "source filter does NOT include description");
231232
}
232233
----
233234

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ new SearchRequest<Project>()
4646
{
4747
Size = 0,
4848
Aggregations = new DateHistogramAggregation("projects_started_per_month")
49-
{
50-
Field = "startedOn",
51-
Interval = DateInterval.Month,
52-
Aggregations = new SumAggregation("commits", "numberOfCommits")
53-
}
54-
&& new AverageBucketAggregation("average_commits_per_month", "projects_started_per_month>commits")
55-
{
56-
GapPolicy = GapPolicy.InsertZeros
57-
}
49+
{
50+
Field = "startedOn",
51+
Interval = DateInterval.Month,
52+
Aggregations = new SumAggregation("commits", "numberOfCommits")
53+
}
54+
&& new AverageBucketAggregation("average_commits_per_month", "projects_started_per_month>commits")
55+
{
56+
GapPolicy = GapPolicy.InsertZeros
57+
}
5858
}
5959
----
6060

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ s => s
4444
.Add("totalCommits", "commits")
4545
.Add("stableCommits", "stable_state>commits")
4646
)
47-
.Script(ss =>ss.Inline("stableCommits / totalCommits * 100").Lang("groovy"))
47+
.Script(ss => ss.Inline("stableCommits / totalCommits * 100").Lang("groovy"))
4848
)
4949
)
5050
)
@@ -74,10 +74,10 @@ new SearchRequest<Project>()
7474
Aggregations = new SumAggregation("commits", "numberOfCommits")
7575
} &&
7676
new BucketScriptAggregation("stable_percentage", new MultiBucketsPath
77-
{
78-
{ "totalCommits", "commits" },
79-
{ "stableCommits", "stable_state>commits" }
80-
})
77+
{
78+
{ "totalCommits", "commits" },
79+
{ "stableCommits", "stable_state>commits" }
80+
})
8181
{
8282
Script = new InlineScript("stableCommits / totalCommits * 100") { Lang = "groovy" }
8383
}
@@ -147,7 +147,7 @@ projectsPerMonth.Should().NotBeNull();
147147
projectsPerMonth.Buckets.Should().NotBeNull();
148148
projectsPerMonth.Buckets.Count.Should().BeGreaterThan(0);
149149
150-
foreach(var item in projectsPerMonth.Buckets)
150+
foreach (var item in projectsPerMonth.Buckets)
151151
{
152152
var stablePercentage = item.BucketScript("stable_percentage");
153153
stablePercentage.Should().NotBeNull();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ new SearchRequest<Project>()
5454
Aggregations =
5555
new SumAggregation("commits", "numberOfCommits") &&
5656
new BucketSelectorAggregation("commits_bucket_filter", new MultiBucketsPath
57-
{
58-
{ "totalCommits", "commits" },
59-
})
57+
{
58+
{ "totalCommits", "commits" },
59+
})
6060
{
6161
Script = new InlineScript("totalCommits >= 500") { Lang = "groovy" }
6262
}

0 commit comments

Comments
 (0)