WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Geo Hash Grid Aggregation Usage
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Geo Hash Grid Aggregation Usage
editFluent DSL example
edits => s .Aggregations(a => a .GeoHash("my_geohash_grid", g => g .Field(p => p.Location) .GeoHashPrecision(GeoHashPrecision.Precision3) .Size(1000) .ShardSize(100) ) )
Object Initializer syntax example
editnew SearchRequest<Project> { Aggregations = new GeoHashGridAggregation("my_geohash_grid") { Field = Field<Project>(p => p.Location), Precision = GeoHashPrecision.Precision3, Size = 1000, ShardSize = 100 } }
Example json output.
{ "aggs": { "my_geohash_grid": { "geohash_grid": { "field": "location", "precision": 3, "size": 1000, "shard_size": 100 } } } }
Handling Responses
editresponse.ShouldBeValid(); var myGeoHashGrid = response.Aggs.GeoHash("my_geohash_grid"); myGeoHashGrid.Should().NotBeNull();
Was this helpful?
Thank you for your feedback.