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-branch_3x.patch
        19 kB
        Jan Høydahl
      2. SOLR-2383-branch_3x.patch
        9 kB
        Jan Høydahl
      3. SOLR-2383-branch_3x.patch
        8 kB
        Jan Høydahl
      4. SOLR-2383-branch_3x.patch
        9 kB
        Jan Høydahl
      5. SOLR-2383-branch_32.patch
        9 kB
        Jan Høydahl
      6. SOLR-2383.patch
        7 kB
        Jan Høydahl
      7. SOLR-2383.patch
        6 kB
        Jan Høydahl
      8. SOLR-2383.patch
        7 kB
        Jan Høydahl
      9. SOLR-2383.patch
        3 kB
        Jan Høydahl
      10. SOLR-2383.patch
        3 kB
        Jan Høydahl

        Issue Links

          Activity

          Hide
          Robert Muir added a comment -

          bulk close for 3.4

          Show
          Robert Muir added a comment - bulk close for 3.4
          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
          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 -

          Checked in backport to 3.x

          Show
          Jan Høydahl added a comment - Checked in backport to 3.x
          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
          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 -

          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
          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
          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 -

          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?
          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?
          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.
          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?
          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
          Robert Muir added a comment -

          Bulk move 3.2 -> 3.3

          Show
          Robert Muir added a comment - Bulk move 3.2 -> 3.3
          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 }
          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
          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.
          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
          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
          Jan Høydahl added a comment -

          Updated to trunk

          Show
          Jan Høydahl added a comment - Updated to trunk
          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 -

          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
          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
          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>

            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