You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file has been generated from https://github.com/elastic/elasticsearch-net/tree/7.x/src/Tests/Tests/Aggregations/Metric/GeoLine/GeoLineAggregationUsageTests.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
+
[[geo-line-aggregation-usage]]
16
+
=== Geo Line Aggregation Usage
17
+
18
+
The geo_line aggregation aggregates all geo_point values within a bucket into a LineString ordered by the chosen sort field.
19
+
20
+
Be sure to read the Elasticsearch documentation on {ref_current}/search-aggregations-metrics-geo-line.html[Geo-Line Aggregation].
21
+
22
+
==== Fluent DSL example
23
+
24
+
[source,csharp]
25
+
----
26
+
a => a
27
+
.GeoLine("line", d => d
28
+
.Point(p => p.LocationPoint)
29
+
.Sort(p => p.StartedOn)
30
+
.IncludeSort()
31
+
.Size(25))
32
+
----
33
+
34
+
==== Object Initializer syntax example
35
+
36
+
[source,csharp]
37
+
----
38
+
new GeoLineAggregation("line", Field<Project>(f => f.LocationPoint), Field<Project>(f => f.StartedOn))
39
+
{
40
+
IncludeSort = true,
41
+
Size = 25
42
+
}
43
+
----
44
+
45
+
[source,javascript]
46
+
.Example json output
47
+
----
48
+
{
49
+
"line": {
50
+
"geo_line": {
51
+
"point": {
52
+
"field": "locationPoint"
53
+
},
54
+
"sort": {
55
+
"field": "startedOn"
56
+
},
57
+
"include_sort": true,
58
+
"size": 25
59
+
}
60
+
}
61
+
}
62
+
----
63
+
64
+
==== Handling Responses
65
+
66
+
[source,csharp]
67
+
----
68
+
response.ShouldBeValid();
69
+
var geoLine = response.Aggregations.GeoLine("line");
0 commit comments