Skip to content

Commit e78688e

Browse files
committed
fixed build warnings
1 parent c516f59 commit e78688e

File tree

77 files changed

+250
-4380
lines changed

Some content is hidden

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

77 files changed

+250
-4380
lines changed

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

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -15,85 +15,12 @@ please modify the original csharp file found at the link and submit the PR with
1515
[[adjacency-matrix-usage]]
1616
=== Adjacency Matrix Usage
1717

18-
==== Fluent DSL example
19-
20-
[source,csharp]
21-
----
22-
s => s
23-
.Size(0)
24-
.Aggregations(aggs => aggs
25-
.AdjacencyMatrix("interactions", am => am
26-
.Filters(fs => fs
27-
.Filter("grpA", f => f.Term(p => p.State, StateOfBeing.BellyUp))
28-
.Filter("grpB", f => f.Term(p => p.State, StateOfBeing.Stable))
29-
.Filter("grpC", f => f.Term(p => p.State, StateOfBeing.VeryActive))
30-
)
31-
)
32-
)
33-
----
34-
35-
==== Object Initializer syntax example
36-
37-
[source,csharp]
38-
----
39-
new SearchRequest<Project>
40-
{
41-
Size = 0,
42-
Aggregations = new AdjacencyMatrixAggregation("interactions")
43-
{
44-
Filters = new NamedFiltersContainer
45-
{
46-
{ "grpA", new TermQuery { Field = "state", Value = StateOfBeing.BellyUp } },
47-
{ "grpB", new TermQuery { Field = "state", Value = StateOfBeing.Stable } },
48-
{ "grpC", new TermQuery { Field = "state", Value = StateOfBeing.VeryActive } },
49-
}
50-
}
51-
}
52-
----
53-
54-
[source,javascript]
55-
.Example json output
56-
----
57-
{
58-
"size": 0,
59-
"aggs": {
60-
"interactions": {
61-
"adjacency_matrix": {
62-
"filters": {
63-
"grpA": {
64-
"term": {
65-
"state": {
66-
"value": "BellyUp"
67-
}
68-
}
69-
},
70-
"grpB": {
71-
"term": {
72-
"state": {
73-
"value": "Stable"
74-
}
75-
}
76-
},
77-
"grpC": {
78-
"term": {
79-
"state": {
80-
"value": "VeryActive"
81-
}
82-
}
83-
}
84-
}
85-
}
86-
}
87-
}
88-
}
89-
----
90-
9118
==== Handling Responses
9219

9320
[source,csharp]
9421
----
9522
response.ShouldBeValid();
96-
var interactions = response.Aggs.AdjacencyMatrix("interactions");
23+
var interactions = response.Aggregations.AdjacencyMatrix("interactions");
9724
interactions.Should().NotBeNull();
9825
var buckets = interactions.Buckets;
9926
buckets.Should().NotBeNullOrEmpty();

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

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -20,66 +20,3 @@ buckets on child documents.
2020

2121
Be sure to read the Elasticsearch documentation on {ref_current}/search-aggregations-bucket-children-aggregation.html[Children Aggregation]
2222

23-
==== Fluent DSL example
24-
25-
[source,csharp]
26-
----
27-
s => s
28-
.Aggregations(aggs => aggs
29-
.Children<CommitActivity>("name_of_child_agg", child => child
30-
.Aggregations(childAggs => childAggs
31-
.Average("average_per_child", avg => avg.Field(p => p.ConfidenceFactor))
32-
.Max("max_per_child", avg => avg.Field(p => p.ConfidenceFactor))
33-
.Min("min_per_child", avg => avg.Field(p => p.ConfidenceFactor))
34-
)
35-
)
36-
)
37-
----
38-
39-
==== Object Initializer syntax example
40-
41-
[source,csharp]
42-
----
43-
new SearchRequest<Project>
44-
{
45-
Aggregations = new ChildrenAggregation("name_of_child_agg", typeof(CommitActivity))
46-
{
47-
Aggregations =
48-
new AverageAggregation("average_per_child", "confidenceFactor")
49-
&& new MaxAggregation("max_per_child", "confidenceFactor")
50-
&& new MinAggregation("min_per_child", "confidenceFactor")
51-
}
52-
}
53-
----
54-
55-
[source,javascript]
56-
.Example json output
57-
----
58-
{
59-
"aggs": {
60-
"name_of_child_agg": {
61-
"children": {
62-
"type": "commits"
63-
},
64-
"aggs": {
65-
"average_per_child": {
66-
"avg": {
67-
"field": "confidenceFactor"
68-
}
69-
},
70-
"max_per_child": {
71-
"max": {
72-
"field": "confidenceFactor"
73-
}
74-
},
75-
"min_per_child": {
76-
"min": {
77-
"field": "confidenceFactor"
78-
}
79-
}
80-
}
81-
}
82-
}
83-
}
84-
----
85-

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

Lines changed: 1 addition & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -25,106 +25,6 @@ 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].
2727

28-
==== Fluent DSL example
29-
30-
[source,csharp]
31-
----
32-
s => s
33-
.Index(DefaultSeeder.ProjectsAliasFilter)
34-
.Size(0)
35-
.Aggregations(aggs => aggs
36-
.DateHistogram("projects_started_per_month", date => date
37-
.Field(p => p.StartedOn)
38-
.Interval(DateInterval.Month)
39-
.MinimumDocumentCount(2)
40-
.Format("yyyy-MM-dd'T'HH:mm:ss")
41-
.ExtendedBounds(FixedDate.AddYears(-1), FixedDate.AddYears(1))
42-
.Order(HistogramOrder.CountAscending)
43-
.Missing(FixedDate)
44-
.Aggregations(childAggs => childAggs
45-
.Nested("project_tags", n => n
46-
.Path(p => p.Tags)
47-
.Aggregations(nestedAggs => nestedAggs
48-
.Terms("tags", avg => avg.Field(p => p.Tags.First().Name))
49-
)
50-
)
51-
)
52-
)
53-
)
54-
----
55-
56-
==== Object Initializer syntax example
57-
58-
[source,csharp]
59-
----
60-
new SearchRequest<Project>(DefaultSeeder.ProjectsAliasFilter)
61-
{
62-
Size = 0,
63-
Aggregations = new DateHistogramAggregation("projects_started_per_month")
64-
{
65-
Field = Field<Project>(p => p.StartedOn),
66-
Interval = DateInterval.Month,
67-
MinimumDocumentCount = 2,
68-
Format = "yyyy-MM-dd'T'HH:mm:ss",
69-
ExtendedBounds = new ExtendedBounds<DateMath>
70-
{
71-
Minimum = FixedDate.AddYears(-1),
72-
Maximum = FixedDate.AddYears(1),
73-
},
74-
Order = HistogramOrder.CountAscending,
75-
Missing = FixedDate,
76-
Aggregations = new NestedAggregation("project_tags")
77-
{
78-
Path = Field<Project>(p => p.Tags),
79-
Aggregations = new TermsAggregation("tags")
80-
{
81-
Field = Field<Project>(p => p.Tags.First().Name)
82-
}
83-
}
84-
}
85-
}
86-
----
87-
88-
[source,javascript]
89-
.Example json output
90-
----
91-
{
92-
"size": 0,
93-
"aggs": {
94-
"projects_started_per_month": {
95-
"date_histogram": {
96-
"field": "startedOn",
97-
"interval": "month",
98-
"min_doc_count": 2,
99-
"format": "yyyy-MM-dd'T'HH:mm:ss||date_optional_time",
100-
"order": {
101-
"_count": "asc"
102-
},
103-
"extended_bounds": {
104-
"min": "2014-06-06T12:01:02.123",
105-
"max": "2016-06-06T12:01:02.123"
106-
},
107-
"missing": "2015-06-06T12:01:02.123"
108-
},
109-
"aggs": {
110-
"project_tags": {
111-
"nested": {
112-
"path": "tags"
113-
},
114-
"aggs": {
115-
"tags": {
116-
"terms": {
117-
"field": "tags.name"
118-
}
119-
}
120-
}
121-
}
122-
}
123-
}
124-
}
125-
}
126-
----
127-
12828
=== Handling responses
12929

13030
Using the `.Aggs` aggregation helper on `ISearchResponse<T>`, we can fetch our aggregation results easily
@@ -136,7 +36,7 @@ in the correct type. <<aggs-vs-aggregations, Be sure to read more about .Aggs vs
13636
----
13737
response.ShouldBeValid();
13838
139-
var dateHistogram = response.Aggs.DateHistogram("projects_started_per_month");
39+
var dateHistogram = response.Aggregations.DateHistogram("projects_started_per_month");
14040
dateHistogram.Should().NotBeNull();
14141
dateHistogram.Buckets.Should().NotBeNull();
14242
dateHistogram.Buckets.Count.Should().BeGreaterThan(10);

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

Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -23,83 +23,6 @@ IMPORTANT: this aggregation includes the `from` value and excludes the `to` valu
2323

2424
Be sure to read the Elasticsearch documentation on {ref_current}/search-aggregations-bucket-daterange-aggregation.html[Date Range Aggregation]
2525

26-
==== Fluent DSL example
27-
28-
[source,csharp]
29-
----
30-
s => s
31-
.Aggregations(aggs => aggs
32-
.DateRange("projects_date_ranges", date => date
33-
.Field(p => p.StartedOn)
34-
.Ranges(
35-
r => r.From(DateMath.Anchored(FixedDate).Add("2d")).To(DateMath.Now),
36-
r => r.To(DateMath.Now.Add(TimeSpan.FromDays(1)).Subtract("30m").RoundTo(TimeUnit.Hour)),
37-
r => r.From(DateMath.Anchored("2012-05-05").Add(TimeSpan.FromDays(1)).Subtract("1m"))
38-
)
39-
.TimeZone("CET")
40-
.Aggregations(childAggs => childAggs
41-
.Terms("project_tags", avg => avg.Field(p => p.Tags))
42-
)
43-
)
44-
)
45-
----
46-
47-
==== Object Initializer syntax example
48-
49-
[source,csharp]
50-
----
51-
new SearchRequest<Project>
52-
{
53-
Aggregations = new DateRangeAggregation("projects_date_ranges")
54-
{
55-
Field = Field<Project>(p => p.StartedOn),
56-
Ranges = new List<DateRangeExpression>
57-
{
58-
new DateRangeExpression { From = DateMath.Anchored(FixedDate).Add("2d"), To = DateMath.Now},
59-
new DateRangeExpression { To = DateMath.Now.Add(TimeSpan.FromDays(1)).Subtract("30m").RoundTo(TimeUnit.Hour) },
60-
new DateRangeExpression { From = DateMath.Anchored("2012-05-05").Add(TimeSpan.FromDays(1)).Subtract("1m") }
61-
},
62-
TimeZone = "CET",
63-
Aggregations =
64-
new TermsAggregation("project_tags") { Field = Field<Project>(p => p.Tags) }
65-
}
66-
}
67-
----
68-
69-
[source,javascript]
70-
.Example json output
71-
----
72-
{
73-
"aggs": {
74-
"projects_date_ranges": {
75-
"date_range": {
76-
"field": "startedOn",
77-
"ranges": [
78-
{
79-
"to": "now",
80-
"from": "2015-06-06T12:01:02.123||+2d"
81-
},
82-
{
83-
"to": "now+1d-30m/h"
84-
},
85-
{
86-
"from": "2012-05-05||+1d-1m"
87-
}
88-
],
89-
"time_zone": "CET"
90-
},
91-
"aggs": {
92-
"project_tags": {
93-
"terms": {
94-
"field": "tags"
95-
}
96-
}
97-
}
98-
}
99-
}
100-
}
101-
----
102-
10326
=== Handling Responses
10427

10528
Using the `.Agg` aggregation helper we can fetch our aggregation results easily
@@ -111,7 +34,7 @@ in the correct type. <<aggs-vs-aggregations, Be sure to read more about .Aggs vs
11134
----
11235
response.ShouldBeValid();
11336
114-
var dateHistogram = response.Aggs.DateRange("projects_date_ranges");
37+
var dateHistogram = response.Aggregations.DateRange("projects_date_ranges");
11538
dateHistogram.Should().NotBeNull();
11639
dateHistogram.Buckets.Should().NotBeNull();
11740
----

0 commit comments

Comments
 (0)