ongr/elasticsearch-dsl
Object-oriented Elasticsearch query builder for PHP. Build searches, filters, aggregations and more with a DSL, then export to arrays for elasticsearch-php or ONGR ElasticsearchBundle. Supports Elasticsearch 5/6/7 via versioned releases.
More info about geo hash grid aggregation is in the official elasticsearch docs
A multi-bucket aggregation that works on geo_point fields and groups points into buckets that represent cells in a grid.
{
"aggregations" : {
"GrainGeoHashGrid" : {
"geohash_grid" : {
"field" : "location",
"precision" : 3
}
}
}
}
And now the query via DSL:
$geoHashGridAggregation = new GeoHashGridAggregation(
'GrainGeoHashGrid',
'location',
3
);
$search = new Search();
$search->addAggregation($geoHashGridAggregation);
$queryArray = $search->toArray();
How can I help you explore Laravel packages today?