IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Geo Tile Grid Aggregation Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Geo Tile Grid Aggregation Usage
editFluent DSL example
edita => a
.GeoTile("my_geotile", g => g
.Field(p => p.LocationPoint)
.Precision(GeoTilePrecision.Precision3)
.Size(1000)
.ShardSize(100)
)
Object Initializer syntax example
editnew GeoTileGridAggregation("my_geotile")
{
Field = Field<Project>(p => p.LocationPoint),
Precision = GeoTilePrecision.Precision3,
Size = 1000,
ShardSize = 100
}
Example json output.
{
"my_geotile": {
"geotile_grid": {
"field": "locationPoint",
"precision": 3,
"size": 1000,
"shard_size": 100
}
}
}
Handling Responses
editresponse.ShouldBeValid();
var myGeoTileGrid = response.Aggregations.GeoTile("my_geotile");
myGeoTileGrid.Should().NotBeNull();
var firstBucket = myGeoTileGrid.Buckets.First();
firstBucket.Key.Should().NotBeNullOrWhiteSpace();
firstBucket.DocCount.Should().BeGreaterThan(0);