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 bounds aggregation is in the official elasticsearch docs
A metric aggregation that computes the bounding box containing all geo_point values for a field.
{
"aggregations" : {
"viewport" : {
"geo_bounds" : {
"field" : "location",
"wrap_longitude" : true
}
}
}
}
And now the query via DSL:
$geoBoundsAggregation = new GeoBoundsAggregation('viewport', 'location');
$search = new Search();
$search->addAggregation($geoBoundsAggregation);
$queryArray = $search->toArray();
How can I help you explore Laravel packages today?