Lucene - Core
  1. Lucene - Core
  2. LUCENE-4586

Change default ResultMode of FacetRequest to PER_NODE_IN_TREE

    Details

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

      Description

      Today the default ResultMode is GLOBAL_FLAT, but it should be PER_NODE_IN_TREE. ResultMode is being used whenever you set the depth of FacetRequest to greater than 1. The difference between the two is:

      • PER_NODE_IN_TREE would then compute the top-K categories recursively, for every top category at every level (up to depth). The results are returned in a tree structure as well. For instance:
      Date
        2010
          March
          February
        2011
          April
          May
      
      • GLOBAL_FLAT computes the top categories among all the nodes up to depth, and returns a flat list of categories.

      GLOBAL_FLAT is faster to compute than PER_NODE_IN_TREE (it just computes top-K among N total categories), however I think that it's less intuitive, and therefore should not be used as a default. In fact, I think this is kind of an expert usage.

      1. LUCENE-4586.patch
        9 kB
        Shai Erera
      2. LUCENE-4586.patch
        9 kB
        Shai Erera

        Activity

        Hide
        Shai Erera added a comment -

        Patch changes the default ResultMode to PER_NODE_IN_TREE. That uncovered a potential bug in TopKInEachNodeHandler where it didn't resolve ties on facet values by ordinal – this lead to inconsistent ordering of facet results (discovered by SamplingWrapperTest).

        I had to fix some tests that relied on GLOBAL_FLAT mode for results verification (it's easier to verify results in that mode).

        Added a CHANGES entry under back-compat changes.

        All tests pass (tried many iterations).

        Show
        Shai Erera added a comment - Patch changes the default ResultMode to PER_NODE_IN_TREE. That uncovered a potential bug in TopKInEachNodeHandler where it didn't resolve ties on facet values by ordinal – this lead to inconsistent ordering of facet results (discovered by SamplingWrapperTest). I had to fix some tests that relied on GLOBAL_FLAT mode for results verification (it's easier to verify results in that mode). Added a CHANGES entry under back-compat changes. All tests pass (tried many iterations).
        Hide
        Shai Erera added a comment -

        Same patch, but moved the CHANGES entry under a "Changes in Runtime Behavior" section

        Show
        Shai Erera added a comment - Same patch, but moved the CHANGES entry under a "Changes in Runtime Behavior" section
        Hide
        Gilad Barkai added a comment -

        Patch looks good, ready for a commit.
        +1

        Show
        Gilad Barkai added a comment - Patch looks good, ready for a commit. +1
        Hide
        Shai Erera added a comment -

        Thanks. I'll give tests a couple more runs on my box before I commit.

        Show
        Shai Erera added a comment - Thanks. I'll give tests a couple more runs on my box before I commit.
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] Shai Erera
        http://svn.apache.org/viewvc?view=revision&revision=1417362

        LUCENE-4586: Change default ResultMode of FacetRequest to PER_NODE_IN_TREE

        Show
        Commit Tag Bot added a comment - [trunk commit] Shai Erera http://svn.apache.org/viewvc?view=revision&revision=1417362 LUCENE-4586 : Change default ResultMode of FacetRequest to PER_NODE_IN_TREE
        Hide
        Shai Erera added a comment -

        Committed to trunk and 4x. I also ran a short test to verify that top-K computation time is not affected by the change.

        Thanks Gilad !

        Show
        Shai Erera added a comment - Committed to trunk and 4x. I also ran a short test to verify that top-K computation time is not affected by the change. Thanks Gilad !
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Shai Erera
        http://svn.apache.org/viewvc?view=revision&revision=1417364

        LUCENE-4586: Change default ResultMode of FacetRequest to PER_NODE_IN_TREE

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Shai Erera http://svn.apache.org/viewvc?view=revision&revision=1417364 LUCENE-4586 : Change default ResultMode of FacetRequest to PER_NODE_IN_TREE
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Shai Erera
        http://svn.apache.org/viewvc?view=revision&revision=1417364

        LUCENE-4586: Change default ResultMode of FacetRequest to PER_NODE_IN_TREE

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Shai Erera http://svn.apache.org/viewvc?view=revision&revision=1417364 LUCENE-4586 : Change default ResultMode of FacetRequest to PER_NODE_IN_TREE

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development