Solr
  1. Solr
  2. SOLR-2383

Velocity: Generalize range and date facet display

    Details

      Description

      Velocity (/browse) GUI has hardcoded price range facet and a hardcoded manufacturedate_dt date facet. Need general solution which work for any facet.range and facet.date.

      1. SOLR-2383.patch
        7 kB
        Jan Høydahl
      2. SOLR-2383.patch
        6 kB
        Jan Høydahl
      3. SOLR-2383.patch
        7 kB
        Jan Høydahl
      4. SOLR-2383.patch
        3 kB
        Jan Høydahl
      5. SOLR-2383.patch
        3 kB
        Jan Høydahl
      6. SOLR-2383-branch_32.patch
        9 kB
        Jan Høydahl
      7. SOLR-2383-branch_3x.patch
        19 kB
        Jan Høydahl
      8. SOLR-2383-branch_3x.patch
        9 kB
        Jan Høydahl
      9. SOLR-2383-branch_3x.patch
        8 kB
        Jan Høydahl
      10. SOLR-2383-branch_3x.patch
        9 kB
        Jan Høydahl

        Issue Links

        There are no Sub-Tasks for this issue.

          Activity

          Jan Høydahl created issue -
          Hide
          Jan Høydahl added a comment -

          Attachd patch fixes generalized display of facet.ranges

          • Iterate over all available facet.ranges
          • Use field name as Display value (capitalized)
          • Fixes bug with wrongly quoted range string
          • Fixes bug where the "More than.." was always displayed
          • Displays the range label as <from> - <to>
          Show
          Jan Høydahl added a comment - Attachd patch fixes generalized display of facet.ranges Iterate over all available facet.ranges Use field name as Display value (capitalized) Fixes bug with wrongly quoted range string Fixes bug where the "More than.." was always displayed Displays the range label as <from> - <to>
          Jan Høydahl made changes -
          Field Original Value New Value
          Attachment SOLR-2383.patch [ 12472011 ]
          Hide
          Jan Høydahl added a comment -

          Revising patch.

          Also, adds a range facet for popularity field

          Show
          Jan Høydahl added a comment - Revising patch. Also, adds a range facet for popularity field
          Jan Høydahl made changes -
          Attachment SOLR-2383.patch [ 12472014 ]
          Hide
          Jan Høydahl added a comment -

          This last patch adds the following:

          • Same generic treatment of facet.dates as for facet.range
          • Added the gap in plain text to the printout, i.e. prints "Jan 2006 +1YEAR" instead of only "Jan 2006"
          • Reduced font size of the "toggle parsed query" and made it stylable instead of hardcoding a <pre> tag
          Show
          Jan Høydahl added a comment - This last patch adds the following: Same generic treatment of facet.dates as for facet.range Added the gap in plain text to the printout, i.e. prints "Jan 2006 +1YEAR" instead of only "Jan 2006" Reduced font size of the "toggle parsed query" and made it stylable instead of hardcoding a <pre> tag
          Jan Høydahl made changes -
          Attachment SOLR-2383.patch [ 12472064 ]
          Jan Høydahl made changes -
          Summary Velocity: Generalize range facet display Velocity: Generalize range and date facet display
          Description Velocity (/browse) GUI has hardcoded price range facet. Need general solution which work for any ranges. Velocity (/browse) GUI has hardcoded price range facet and a hardcoded manufacturedate_dt date facet. Need general solution which work for any facet.range and facet.date.
          Jan Høydahl made changes -
          Link This issue is duplicated by SOLR-2398 [ SOLR-2398 ]
          Hide
          Jan Høydahl added a comment -

          Would appreciate if someone could test out this patch on your own data and test various combinations of facet.range and gaps to see if it is water tight

          Show
          Jan Høydahl added a comment - Would appreciate if someone could test out this patch on your own data and test various combinations of facet.range and gaps to see if it is water tight
          Hide
          Jan Høydahl added a comment -

          Updated to trunk

          Show
          Jan Høydahl added a comment - Updated to trunk
          Jan Høydahl made changes -
          Attachment SOLR-2383.patch [ 12476052 ]
          Hide
          Yonik Seeley added a comment -

          I started to take a look at this, but ran into exceptions due to SOLR-1566

          Show
          Yonik Seeley added a comment - I started to take a look at this, but ran into exceptions due to SOLR-1566
          Hide
          Yonik Seeley added a comment -

          Looking good Jan!

          I did notice one issue with the example data:
          the "popularity 3-6" link shows 1 match, but when I click it, I get 6 results.

          I believe this is because the faceting is finding (3 <= popularity < 6) while the filter generated by clicking on the link is popularity:[3 TO 6]
          So I guess the generated filters should generally be of the form popularity:[3 TO 6} ?

          Show
          Yonik Seeley added a comment - Looking good Jan! I did notice one issue with the example data: the "popularity 3-6" link shows 1 match, but when I click it, I get 6 results. I believe this is because the faceting is finding (3 <= popularity < 6) while the filter generated by clicking on the link is popularity: [3 TO 6] So I guess the generated filters should generally be of the form popularity:[3 TO 6} ?
          Hide
          Jan Høydahl added a comment -

          Yonik, you're right. With the new default to have the upper range exclusive, we need to adjust the fq.

          This new patch uses '}' as upper boundary for the filters for both range and date, making the counts correct for the example.

          NOTE: I have not attempted to make it smart enough to obey facet.range.include.

          Show
          Jan Høydahl added a comment - Yonik, you're right. With the new default to have the upper range exclusive, we need to adjust the fq. This new patch uses '}' as upper boundary for the filters for both range and date, making the counts correct for the example. NOTE: I have not attempted to make it smart enough to obey facet.range.include.
          Jan Høydahl made changes -
          Attachment SOLR-2383.patch [ 12476588 ]
          Yonik Seeley made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 4.0 [ 12314992 ]
          Resolution Fixed [ 1 ]
          Grant Ingersoll made changes -
          Assignee Grant Ingersoll [ gsingers ]
          Grant Ingersoll made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Jan Høydahl added a comment -

          Reopening to add patch for branch 3.2

          Show
          Jan Høydahl added a comment - Reopening to add patch for branch 3.2
          Jan Høydahl made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Hide
          Jan Høydahl added a comment -

          This Velocity enhancement should make it to 3.2.

          In this patch I back-port what was committed for 4.0, with these exceptions:

          • No pivot facets
          • End range uses ] instead of }
          Show
          Jan Høydahl added a comment - This Velocity enhancement should make it to 3.2. In this patch I back-port what was committed for 4.0, with these exceptions: No pivot facets End range uses ] instead of }
          Jan Høydahl made changes -
          Attachment SOLR-2383-branch_32.patch [ 12479323 ]
          Jan Høydahl made changes -
          Fix Version/s 3.2 [ 12316172 ]
          Hide
          Robert Muir added a comment -

          Bulk move 3.2 -> 3.3

          Show
          Robert Muir added a comment - Bulk move 3.2 -> 3.3
          Robert Muir made changes -
          Fix Version/s 3.3 [ 12316471 ]
          Fix Version/s 4.0 [ 12314992 ]
          Fix Version/s 3.2 [ 12316172 ]
          Hide
          Jan Høydahl added a comment -

          3.3 will support the [from TO to} syntax, right? Attempt to get this in for 3.3. Grant?

          Show
          Jan Høydahl added a comment - 3.3 will support the [from TO to} syntax, right? Attempt to get this in for 3.3. Grant?
          Hide
          Jan Høydahl added a comment -

          This patch (SOLR-2383-branch_3x.patch) works with 3x branch. Ready for commit?

          Show
          Jan Høydahl added a comment - This patch ( SOLR-2383 -branch_3x.patch) works with 3x branch. Ready for commit?
          Jan Høydahl made changes -
          Attachment SOLR-2383-branch_3x.patch [ 12483886 ]
          Jan Høydahl made changes -
          Fix Version/s 3.4 [ 12316683 ]
          Fix Version/s 4.0 [ 12314992 ]
          Fix Version/s 3.3 [ 12316471 ]
          Hide
          Jan Høydahl added a comment -

          Moved date facet over to range facet. Fixed popularity facet.

          Only problem now is that 3.x does not have support for exclusive range queries [from TO to} so the count when clicking a range facet is wrong.

          Show
          Jan Høydahl added a comment - Moved date facet over to range facet. Fixed popularity facet. Only problem now is that 3.x does not have support for exclusive range queries [from TO to} so the count when clicking a range facet is wrong.
          Jan Høydahl made changes -
          Attachment SOLR-2383-branch_3x.patch [ 12483890 ]
          Hide
          Grant Ingersoll added a comment -

          Jan, you want to take this one?

          Show
          Grant Ingersoll added a comment - Jan, you want to take this one?
          Grant Ingersoll made changes -
          Assignee Grant Ingersoll [ gsingers ]
          Jan Høydahl made changes -
          Assignee Jan Høydahl [ janhoy ]
          Hide
          Jan Høydahl added a comment -

          New patch against branch_3x

          Fixed display of date ranges with correct UTC date format. Improved display of float ranges. Removed date facet macro.

          Think this is ready for 3.4, could someone take it for a ride?

          Show
          Jan Høydahl added a comment - New patch against branch_3x Fixed display of date ranges with correct UTC date format. Improved display of float ranges. Removed date facet macro. Think this is ready for 3.4, could someone take it for a ride?
          Jan Høydahl made changes -
          Attachment SOLR-2383-branch_3x.patch [ 12492838 ]
          Hide
          Jan Høydahl added a comment -

          Hmm, found some bugs already, will do another one

          Show
          Jan Høydahl added a comment - Hmm, found some bugs already, will do another one
          Hide
          Jan Høydahl added a comment -

          Fixed bug in some ranges, which contained whitespace due to Velocity macro. Also, now always displays date range end as a datemath

          Show
          Jan Høydahl added a comment - Fixed bug in some ranges, which contained whitespace due to Velocity macro. Also, now always displays date range end as a datemath
          Jan Høydahl made changes -
          Attachment SOLR-2383-branch_3x.patch [ 12492890 ]
          Hide
          Jan Høydahl added a comment -

          Plan to commit this in a day or two, if no objections

          Show
          Jan Høydahl added a comment - Plan to commit this in a day or two, if no objections
          Hide
          Bill Bell added a comment -

          Does this mean the [0 TO 8} will not work?

          popularity:[3 TO 6} ?

          Thanks.

          Show
          Bill Bell added a comment - Does this mean the [0 TO 8} will not work? popularity:[3 TO 6} ? Thanks.
          Hide
          Jan Høydahl added a comment -

          @Bill
          Yes, the exclusive upper range syntax [x TO y} only works on 4.0, and I haven't found a good way to emulate the same behaviour in 3.x. This means that you'll sometimes see more hits when clicking a facet than the number presented, being the values exactly on the upper bound. Do you have a suggestion?

          Show
          Jan Høydahl added a comment - @Bill Yes, the exclusive upper range syntax [x TO y} only works on 4.0, and I haven't found a good way to emulate the same behaviour in 3.x. This means that you'll sometimes see more hits when clicking a facet than the number presented, being the values exactly on the upper bound. Do you have a suggestion?
          Hide
          Jan Høydahl added a comment -

          Checked in backport to 3.x

          Show
          Jan Høydahl added a comment - Checked in backport to 3.x
          Jan Høydahl made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          David Smiley added a comment -

          Jan,
          To get around the Solr 3x limitation on not being able to say [x TO y}, you can still do: [x TO y] -y
          I tell readers about this in the 2nd edition of my Solr book due the end of October.

          Show
          David Smiley added a comment - Jan, To get around the Solr 3x limitation on not being able to say [x TO y}, you can still do: [x TO y] -y I tell readers about this in the 2nd edition of my Solr book due the end of October.
          Hide
          Jan Høydahl added a comment -

          David. Thanks for your comment. You are welcome to submit a patch which fixes this in the Velocity templates in 3x - would be nice.

          Show
          Jan Høydahl added a comment - David. Thanks for your comment. You are welcome to submit a patch which fixes this in the Velocity templates in 3x - would be nice.
          Hide
          Robert Muir added a comment -

          bulk close for 3.4

          Show
          Robert Muir added a comment - bulk close for 3.4
          Robert Muir made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Jan Høydahl
              Reporter:
              Jan Høydahl
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development