Aggregation API support - adamwojs/formatted-textline GitHub Wiki

This bundle provides integration with Aggregation API.

FormattedTextLineTermAggregation

\AdamWojs\IbexaFormattedTextLineBundle\Search\Query\Aggregation\FormattedTextLineTermAggregation could be used to group location/content object by value of any field type based on AdamWojs\IbexaFormattedTextLineBundle\FieldType\FormattedTextLine\Type:

$query = new Query();
$query->aggregations[] = new FormattedTextLineTermAggregation(
    'customer_by_postal_code',
    'customer',
    'postal_code'
);

$results = $searchService->findContent($query);

$customerByPostalCode = $results->aggregations->get('customer_by_postal_code');
foreach ($customerByPostalCode as $postalCode => $count) {
    printf("There is %d customers with %s postal code\n", $count, $postalCode);
}