Solr
  1. Solr
  2. SOLR-1103

LukeRequestHandler histogram excludes freq of 1

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: None
    • Labels:
      None

      Description

      the TermHistogram class in the LukeRequestHandler seems to properly count the occurances of terms with a freq of "1", but then when converting to a NamedLIst begins iterating at bucket "2" so the counts for freq of "1" don't appear in the result.

      this may have been a conscious choice to eliminate superfluously high values for terms with a freq of one ... or it may have been a mistake assuming freq values of 1 would fall in the "2" bucket.

        Activity

        Hide
        Hoss Man added a comment -

        possible ways to resolve this...
        1) add a comment clarifying that the current behavior is desired
        2) make iteration start at "1"
        3) change getPowerOfTwoBucket so "2" is the lowest bucket value it ever returns.

        Show
        Hoss Man added a comment - possible ways to resolve this... 1) add a comment clarifying that the current behavior is desired 2) make iteration start at "1" 3) change getPowerOfTwoBucket so "2" is the lowest bucket value it ever returns.
        Hide
        Yonik Seeley added a comment -

        Should this be fixed for 1.4?

        Show
        Yonik Seeley added a comment - Should this be fixed for 1.4?
        Hide
        Hoss Man added a comment -

        yeah ... fixing should be trivial, i just wasn't sure where the bug was (the iteration, or the bucket assignment)

        Show
        Hoss Man added a comment - yeah ... fixing should be trivial, i just wasn't sure where the bug was (the iteration, or the bucket assignment)
        Hide
        Grant Ingersoll added a comment -

        Hoss,

        Do you have a fix for this?

        Show
        Grant Ingersoll added a comment - Hoss, Do you have a fix for this?
        Hide
        Hoss Man added a comment -

        There were three possible fixes depending on what people thought the correct behavior should be.

        i don't have the code in front of me, but as i recall they were all trivial...

        1) add a comment
        2) change a for loop to start at 1 instead of 2
        3) change getPowerOfTwoBucket to have something like...

        return result < 2 ? 2 : result;
        

        I think Ryan wrote this code originally: Ryan, do you have any recollection as to what the orriginal intent was with the first bucket?

        Show
        Hoss Man added a comment - There were three possible fixes depending on what people thought the correct behavior should be. i don't have the code in front of me, but as i recall they were all trivial... 1) add a comment 2) change a for loop to start at 1 instead of 2 3) change getPowerOfTwoBucket to have something like... return result < 2 ? 2 : result; I think Ryan wrote this code originally: Ryan, do you have any recollection as to what the orriginal intent was with the first bucket?
        Hide
        Hoss Man added a comment -

        Committed revision 810324.

        i went ahead and fixed this using the "display the '1' bucket" approach.

        Show
        Hoss Man added a comment - Committed revision 810324. i went ahead and fixed this using the "display the '1' bucket" approach.
        Hide
        Grant Ingersoll added a comment -

        Bulk close for Solr 1.4

        Show
        Grant Ingersoll added a comment - Bulk close for Solr 1.4

          People

          • Assignee:
            Hoss Man
            Reporter:
            Hoss Man
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development