Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-19437

Multiple range facets

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium 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?

      Attachments

        Activity

          People

            unknown unknown
            43f49ffc-cd9b-4f81-a89b-a0d2f59e446c@accounts.ibexa.co Rob Clews
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: