public function handle( CriteriaPartInterface
$criteriaPart,
Criteria
$criteria,
Search
$search,
ShopContextInterface
$context ) { $aggregation =
new ValueCountAggregation('has_available_variant_count'
);
$aggregation->
setField('hasAvailableVariant'
);
$filter =
new FilterAggregation('has_available_variant_filter'
);
$filter->
setFilter(new TermQuery('hasAvailableVariant', true
));
$filter->
addAggregation($aggregation);
$search->
addAggregation($filter);
} /**
* {@inheritdoc}
*/
public function hydrate( array
$elasticResult,
ProductNumberSearchResult
$result,