Repository navigation
Replies: 2 comments
|
Directly on the If you need the aggregations to be part of your paginated dataset, you might be able to handle it already with one of the other adapters that have hook points (i.e. the callback or transforming adapters) or implement your own decorator around the |
0 replies
|
After some inspection of the inner live, I`ve discovered one easy option: $quantityAgg = new Aggregation\Sum('sum_quantity');
$quantityAgg->setField('quantity');
$query = (new Query())
->setQuery($yourQuery)
->addAggregation($quantityAgg)
;Then on return [
'agg' => [
'sum_quantity' => $resultSet->getAggregation('sum_quantity')['value'] ?? 0,
],
]; |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I need to sum up a field on the ElasticaAdapter.
I am curious if it is possible to use aggregations with
ElasticaAdapter?Or are there any plans to implement that in future?
All reactions