Skip to content

TimeRangeAggregation

The field-based TimeRangeAggregation aggregates search results by the value of the Date, DateTime, or Time 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
$query = new Query();
$query->aggregations[] = new Aggregation\Field\TimeRangeAggregation('date', 'event', 'event_time',
[
    new Query\Aggregation\Range(null, new DateTime('T14:00')),
    new Query\Aggregation\Range(new DateTime('T14:003'), null),
]);