catch (Exception
$e) { } $this->criteriaParts
[] =
$criteriaPart;
switch ($criteriaPart->
getMode()) { case ProductAttributeFacet::MODE_VALUE_LIST_RESULT:
case ProductAttributeFacet::MODE_RADIO_LIST_RESULT:
if ($type === 'string'
) { $field .= '.raw';
} $aggregation =
new TermsAggregation($criteriaPart->
getName());
$aggregation->
setField($field);
$aggregation->
addParameter('size', self::AGGREGATION_SIZE
);
break;
case ProductAttributeFacet::MODE_BOOLEAN_RESULT:
$count =
new ValueCountAggregation($criteriaPart->
getName() . '_count'
);
$count->
setField($field);
$aggregation =
new FilterAggregation($criteriaPart->
getName());
$aggregation->
setFilter(new ExistsQuery($field));
$aggregation->
addAggregation($count);