Details
-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
4.7.0alpha1, 4.6.0
-
None
Description
Specifying multiple range facets only returns the data for one of the facets and you cannot have a range facet without a field facet.
Steps to reproduce
Template:
{def $facets = array( hash( 'range', hash( 'field', 'product/price', 'start', 1, 'end', 50, 'gap', '10' ), 'field', 'product/price', 'name', 'Price' ), hash( 'range', hash( 'field', 'product/weight', 'start', 1, 'end', 1000, 'gap', '100' ), 'field', 'product/weight', 'name', 'Weight' ), )}In ezfezpsolrquerybuilder.php the following line (1174) means only one facet will be permitted as the variable is overwritten on each iteration:
$queryParamList['facet.range'] = $fieldName;
Amending to the following returns all the defined facets:
$queryParamList['facet.range'][] = $fieldName;
The multiple definition of 'field' per facet is necessary because of the following line (1168) in ezfezpsolrquerybuilder.php.
$fieldName = eZSolr::getFieldName( $facetDefinition['field'], false, 'facet' );
This should be:
$fieldName = eZSolr::getFieldName( $facetDefinition['range']['field'], false, 'facet' );
Fixing those made multiple range facets work for me, unless I'm using it wrong?