Skip to content

FloatRangeAggregation

The Field-based FloatRangeAggregation aggregates search results by the value of the Float Field.

Arguments

  • name - name of the Aggregation object
  • contentTypeIdentifier - string representing the Content Type identifier
  • fieldDefinitionIdentifier - string representing the Field identifier
  • ranges - array of Range objects that define the borders of the specific range sets

Example

1
2
3
4
5
6
7
$query = new Query();
$query->aggregations[] = new Aggregation\Field\FloatRangeAggregation('float', 'product', 'weight',
[
    new Query\Aggregation\Range(null, 0.25),
    new Query\Aggregation\Range(0.25, 0.75),
    new Query\Aggregation\Range(0.75, null),
]);