IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Geo Line Aggregation Usage
editGeo Line Aggregation Usage
editThe geo_line aggregation aggregates all geo_point values within a bucket into a LineString ordered by the chosen sort field.
Be sure to read the Elasticsearch documentation on Geo-Line Aggregation.
Fluent DSL example
edita => a .GeoLine("line", d => d .Point(p => p.LocationPoint) .Sort(p => p.StartedOn) .IncludeSort() .Size(25))
Object Initializer syntax example
editnew GeoLineAggregation("line", Field<Project>(f => f.LocationPoint), Field<Project>(f => f.StartedOn)) { IncludeSort = true, Size = 25 }
Example json output.
{ "line": { "geo_line": { "point": { "field": "locationPoint" }, "sort": { "field": "startedOn" }, "include_sort": true, "size": 25 } } }
Handling Responses
editresponse.ShouldBeValid(); var geoLine = response.Aggregations.GeoLine("line"); geoLine.Should().NotBeNull(); geoLine.Type.Should().Be("Feature"); geoLine.Geometry.Type.Should().Be("linestring"); geoLine.Geometry.Coordinates.Should().NotBeEmpty(); geoLine.Properties.Complete.Should().BeFalse(); geoLine.Properties.SortValues.Should().NotBeEmpty();