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.
Geohash Grid aggregation
editGeohash Grid aggregation
editA multi-bucket aggregation that works on {ref_current}/mapping-geo-point-type.html[geo_point] fields and groups points into buckets that represent cells in a grid.
Fluent DSL
editvar result = client.Search<ElasticsearchProject>(s => s .Aggregations(a => a .GeoHash("my_geohash_agg", g => g .Field(p => p.Origin) .GeoHashPrecision(GeoHashPrecision.Precision3) ) ) ); var agg = result.Aggs.GeoHash("my_geohash_agg");
Object Initializer Syntax
editvar request = new SearchRequest { Aggregations = new Dictionary<string, IAggregationContainer> { { "my_geohash_agg", new AggregationContainer { GeoHash = new GeoHashAggregator { Field = "origin", Precision = GeoHashPrecision.Precision3 } } } } }; var result = client.Search<ElasticsearchProject>(request); var agg = result.Aggs.GeoHash("my_geohash_agg");
Refer to the {ref_current}/search-aggregations-bucket-geohashgrid-aggregation.html[original docs] for more information.