Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 817 Bytes

aggregation.md

File metadata and controls

20 lines (13 loc) · 817 Bytes

##List of supported aggregations

average,cardinality,dateRange,geoBounds,geoDistance,geoHashGrid,histogram,ipv4Range,max,min,missing,percentile,percentileRanks,stats,sum,valueCount,range,terms

Plastic doesn't support all available aggregations yet like the nested aggregation however you can still implement this functionality.

Knowing that Plastic uses ongr-io/ElasticsearchDSL to build the queries we can do the following.

Post::search()->aggregate(function($builder){

  $minAggregation = new MinAggregation('min_price', 'resellers.price');
  $nestedAggregation = new NestedAggregation('resellers', 'resellers');
  $nestedAggregation->addAggregation($minAggregation);

  $builder->append($nestedAggregation);

});