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
 8
 9
10
11
12
13
14
15
use Ibexa\Contracts\Core\Repository\Values\Content\Query;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation;
use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation\Range;

$query = new Query();
$query->aggregations[] = new Aggregation\Field\IntegerRangeAggregation(
    'integer',
    'product',
    'amount',
    [
    Range::ofInt(null, 12),
    Range::ofInt(12, 24),
    Range::ofInt(24, null),
]
);