Skip to content

IntegerRangeAggregation

The Field-based IntegerRangeAggregation aggregates search results by the value of the Integer Field.

Arguments

  • name - name of the Aggregation
  • contentTypeIdentifier - string representing the Content Type identifier
  • fieldDefinitionIdentifier - string representing the Field Definition 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\IntegerRangeAggregation('integer', 'product', 'amount',
[
    new Query\Aggregation\Range(null, 12),
    new Query\Aggregation\Range(12, 24),
    new Query\Aggregation\Range(24, null),
]);