Skip to content

Commit 570a626

Browse files
committed
Update documentation
1 parent 9c2aff8 commit 570a626

File tree

66 files changed

+1303
-368
lines changed

Some content is hidden

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

66 files changed

+1303
-368
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ A multi-bucket aggregation similar to the histogram except it can only be applie
1919
From a functionality perspective, this histogram supports the same features as the normal histogram.
2020
The main difference is that the interval can be specified by date/time expressions.
2121

22-
NOTE: When specifying a `format` **and** `extended_bounds`, in order for Elasticsearch to be able to parse
23-
the serialized `DateTime` of `extended_bounds` correctly, the `date_optional_time` format is included
22+
NOTE: When specifying a `format` **and** `extended_bounds` or `missing`, in order for Elasticsearch to be able to parse
23+
the serialized `DateTime` of `extended_bounds` or `missing` correctly, the `date_optional_time` format is included
2424
as part of the `format` value.
2525

2626
Be sure to read the Elasticsearch documentation on {ref_current}/search-aggregations-bucket-datehistogram-aggregation.html[Date Histogram Aggregation].
@@ -30,6 +30,7 @@ Be sure to read the Elasticsearch documentation on {ref_current}/search-aggregat
3030
[source,csharp]
3131
----
3232
s => s
33+
.Index(DefaultSeeder.ProjectsAliasFilter)
3334
.Size(0)
3435
.Aggregations(aggs => aggs
3536
.DateHistogram("projects_started_per_month", date => date
@@ -56,7 +57,7 @@ s => s
5657

5758
[source,csharp]
5859
----
59-
new SearchRequest<Project>
60+
new SearchRequest<Project>(DefaultSeeder.ProjectsAliasFilter)
6061
{
6162
Size = 0,
6263
Aggregations = new DateHistogramAggregation("projects_started_per_month")
@@ -65,7 +66,7 @@ new SearchRequest<Project>
6566
Interval = DateInterval.Month,
6667
MinimumDocumentCount = 2,
6768
Format = "yyyy-MM-dd'T'HH:mm:ss",
68-
ExtendedBounds = new ExtendedBounds<DateTime>
69+
ExtendedBounds = new ExtendedBounds<DateMath>
6970
{
7071
Minimum = FixedDate.AddYears(-1),
7172
Maximum = FixedDate.AddYears(1),

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ s => s
3636
r => r.To(DateMath.Now.Add(TimeSpan.FromDays(1)).Subtract("30m").RoundTo(TimeUnit.Hour)),
3737
r => r.From(DateMath.Anchored("2012-05-05").Add(TimeSpan.FromDays(1)).Subtract("1m"))
3838
)
39+
.TimeZone("CET")
3940
.Aggregations(childAggs => childAggs
4041
.Terms("project_tags", avg => avg.Field(p => p.Tags))
4142
)
@@ -58,6 +59,7 @@ new SearchRequest<Project>
5859
new DateRangeExpression { To = DateMath.Now.Add(TimeSpan.FromDays(1)).Subtract("30m").RoundTo(TimeUnit.Hour) },
5960
new DateRangeExpression { From = DateMath.Anchored("2012-05-05").Add(TimeSpan.FromDays(1)).Subtract("1m") }
6061
},
62+
TimeZone = "CET",
6163
Aggregations =
6264
new TermsAggregation("project_tags") { Field = Field<Project>(p => p.Tags) }
6365
}
@@ -83,7 +85,8 @@ new SearchRequest<Project>
8385
{
8486
"from": "2012-05-05||+1d-1m"
8587
}
86-
]
88+
],
89+
"time_zone": "CET"
8790
},
8891
"aggs": {
8992
"project_tags": {

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ new SearchRequest<Project>
148148

149149
[source,csharp]
150150
----
151-
response.ShouldBeValid();
152-
response.Aggs.Filter("empty_filter").DocCount.Should().BeGreaterThan(0);
151+
response.ShouldNotBeValid();
153152
----
154153

155154
==== Fluent DSL example
@@ -161,8 +160,7 @@ s => s
161160
.Filter(_aggName, date => date
162161
.Filter(f => f
163162
.Script(b => b
164-
.Inline(_ctxNumberofCommits)
165-
.Lang("groovy")
163+
.Source(_ctxNumberofCommits)
166164
)
167165
)
168166
)
@@ -179,9 +177,8 @@ new SearchRequest<Project>
179177
{
180178
Filter = new ScriptQuery
181179
{
182-
Inline = _ctxNumberofCommits,
183-
Lang = "groovy"
184-
}
180+
Source = _ctxNumberofCommits
181+
}
185182
}
186183
}
187184
----
@@ -195,8 +192,7 @@ new SearchRequest<Project>
195192
"filter": {
196193
"script": {
197194
"script": {
198-
"inline": "_source.numberOfCommits > 0",
199-
"lang": "groovy"
195+
"source": "_source.numberOfCommits > 0"
200196
}
201197
}
202198
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Be sure to read the Elasticsearch documentation {ref_current}/search-aggregation
2929
[source,csharp]
3030
----
3131
s => s
32+
.Index(DefaultSeeder.ProjectsAliasFilter)
3233
.Aggregations(aggs => aggs
3334
.Filters("projects_by_state", agg => agg
3435
.OtherBucket()
@@ -49,7 +50,7 @@ s => s
4950

5051
[source,csharp]
5152
----
52-
new SearchRequest<Project>
53+
new SearchRequest<Project>(DefaultSeeder.ProjectsAliasFilter)
5354
{
5455
Aggregations = new FiltersAggregation("projects_by_state")
5556
{
@@ -149,6 +150,7 @@ namedResult.DocCount.Should().Be(0);
149150
[source,csharp]
150151
----
151152
s => s
153+
.Index(DefaultSeeder.ProjectsAliasFilter)
152154
.Aggregations(aggs => aggs
153155
.Filters("projects_by_state", agg => agg
154156
.OtherBucket()
@@ -168,7 +170,7 @@ s => s
168170

169171
[source,csharp]
170172
----
171-
new SearchRequest<Project>
173+
new SearchRequest<Project>(DefaultSeeder.ProjectsAliasFilter)
172174
{
173175
Aggregations = new FiltersAggregation("projects_by_state")
174176
{

docs/aggregations/bucket/geo-distance/geo-distance-aggregation-usage.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ new SearchRequest<Project>
8787

8888
[source,csharp]
8989
----
90-
response.IsValid.Should().BeTrue();
90+
response.ShouldBeValid();
9191
var ringsAroundAmsterdam = response.Aggs.GeoDistance("rings_around_amsterdam");
9292
ringsAroundAmsterdam.Should().NotBeNull();
9393
ringsAroundAmsterdam.Buckets.FirstOrDefault(r => r.Key == "*-100.0").Should().NotBeNull();

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ s => s
2626
.Interval(100)
2727
.Missing(0)
2828
.Order(HistogramOrder.KeyDescending)
29+
.Offset(1.1)
2930
)
3031
)
3132
----
@@ -41,7 +42,8 @@ new SearchRequest<Project>
4142
Field = Field<Project>(p => p.NumberOfCommits),
4243
Interval = 100,
4344
Missing = 0,
44-
Order = HistogramOrder.KeyDescending
45+
Order = HistogramOrder.KeyDescending,
46+
Offset = 1.1
4547
}
4648
}
4749
----
@@ -58,7 +60,8 @@ new SearchRequest<Project>
5860
"missing": 0.0,
5961
"order": {
6062
"_key": "desc"
61-
}
63+
},
64+
"offset": 1.1
6265
}
6366
}
6467
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ please modify the original csharp file found at the link and submit the PR with
2222
s => s
2323
.Aggregations(a => a
2424
.IpRange("ip_ranges", ip => ip
25-
.Field(p => p.LeadDeveloper.IPAddress)
25+
.Field(p => p.LeadDeveloper.IpAddress)
2626
.Ranges(
2727
r => r.To("10.0.0.5"),
2828
r => r.From("10.0.0.5")
@@ -39,7 +39,7 @@ new SearchRequest<Project>
3939
{
4040
Aggregations = new IpRangeAggregation("ip_ranges")
4141
{
42-
Field = Field((Project p) => p.LeadDeveloper.IPAddress),
42+
Field = Field((Project p) => p.LeadDeveloper.IpAddress),
4343
Ranges = new List<Nest.IpRange>
4444
{
4545
new Nest.IpRange { To = "10.0.0.5" },
@@ -56,7 +56,7 @@ new SearchRequest<Project>
5656
"aggs": {
5757
"ip_ranges": {
5858
"ip_range": {
59-
"field": "leadDeveloper.iPAddress",
59+
"field": "leadDeveloper.ipAddress",
6060
"ranges": [
6161
{
6262
"to": "10.0.0.5"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,8 @@ var sample = response.Aggs.Sampler("sample");
8080
sample.Should().NotBeNull();
8181
var sigTags = sample.SignificantTerms("significant_names");
8282
sigTags.Should().NotBeNull();
83+
sigTags.DocCount.Should().BeGreaterThan(0);
84+
if (TestClient.VersionUnderTestSatisfiedBy(">=5.5.0"))
85+
sigTags.BgCount.Should().BeGreaterThan(0);
8386
----
8487

0 commit comments

Comments
 (0)