Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4, 6.0
    • Component/s: modules/facet
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      When you DrillSideways on a hierarchical dimension, and especially when you OR multiple drill-downs together, you get several FacetResults back, one for each category you drill down on. So for example, if you want to drill-down on Date/2010 OR Date/2011/May, the FacetRequests that you need to create (to get the sideways effect) are: Date/, Date/2010, Date/2011 and Date/2011/May. Date/ is because you want to get sideways counts as an alternative to Date/2010, and Date/2011 in order to get months count as an alternative to Date/2011/May.

      That results in 4 FacetResult objects. Having a utility which merges all FacetResults of the same dimension into a single hierarchical one will be very useful for e.g. apps that want to display the hierarchy. I'm thinking of FacetResult.mergeHierarchies which takes a List<FacetResult> and returns the merged ones, one FacetResult per dimension.

      1. LUCENE-5022.patch
        18 kB
        Shai Erera
      2. LUCENE-5022.patch
        16 kB
        Shai Erera

        Activity

        Hide
        Shai Erera added a comment -

        Patch with the new mergeHierarchies method + test. I created it using git, so hopefully it applies ok (I tried patch --dry-run and it didn't complain).

        Show
        Shai Erera added a comment - Patch with the new mergeHierarchies method + test. I created it using git, so hopefully it applies ok (I tried patch --dry-run and it didn't complain).
        Hide
        Michael McCandless added a comment -

        This looks great Shai! Can it be used for non-hierarchical dims as well? E.g. if I have one FacetRequest for top 10 under User/ and then a second FacetRequest for User/Bob (a "leaf" ... hmm can one make a FacetRequest like that?), will it merge them?

        Or, what would it do if I (oddly) had one FacetRequest asking for top 10 under User/ and another FacetRequest asking for top 20 under User/?

        Show
        Michael McCandless added a comment - This looks great Shai! Can it be used for non-hierarchical dims as well? E.g. if I have one FacetRequest for top 10 under User/ and then a second FacetRequest for User/Bob (a "leaf" ... hmm can one make a FacetRequest like that?), will it merge them? Or, what would it do if I (oddly) had one FacetRequest asking for top 10 under User/ and another FacetRequest asking for top 20 under User/?
        Hide
        Shai Erera added a comment -

        Good questions Mike! They say a test is worth more than a thousand words, so I added tests and they pass. I guess he answer is Yes!

        Show
        Shai Erera added a comment - Good questions Mike! They say a test is worth more than a thousand words, so I added tests and they pass. I guess he answer is Yes!
        Hide
        Michael McCandless added a comment -

        +1, thanks Shai! Very useful...

        Show
        Michael McCandless added a comment - +1, thanks Shai! Very useful...
        Hide
        Shai Erera added a comment -

        Committed to trunk and 4x.

        Show
        Shai Erera added a comment - Committed to trunk and 4x.
        Hide
        Steve Rowe added a comment -

        Bulk close resolved 4.4 issues

        Show
        Steve Rowe added a comment - Bulk close resolved 4.4 issues

          People

          • Assignee:
            Shai Erera
            Reporter:
            Shai Erera
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development