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

      Over at LUCENE-4602, Mike explored the idea of writing just the leaf nodes in the fulltree posting, rather than the full hierarchy. I wrote this simple OrdinalPolicy which achieves that:

      DefaultFacetIndexingParams indexingParams = new DefaultFacetIndexingParams() {
      
        @Override
        protected OrdinalPolicy fixedOrdinalPolicy() {
          return new OrdinalPolicy() {
            public void init(TaxonomyWriter taxonomyWriter) {}
            public boolean shouldAdd(int ordinal) { return false; }
          };
        }
      };
      

      I think that we should add it as a singleton class to OrdinalPolicy.EXACT_CATEGORIES_ONLY, as wel as make DefaultOrdPolicy as singleton too, under the name FULL_HIERARCHY (feel free to suggest a better name).

        Activity

        Hide
        Shai Erera added a comment -

        Patch removes DefaultOrdinalPolicy in favor OrdinalPolicy.ALL_PARENTS. Also adds OrdPolicy.NO_PARENTS (related to LUCENE-4600).

        In that spirit, I also removed DefaultPathPolicy in favor of PathPolicy.ALL_CATEGORIES.

        In general, I chose specific names over e.g. DEFAULT_POLICY, because I think that 'default' in the name is bad. E.g., if following the results in LUCENE-4600 we'll decide to change the default policy, the name 'default' in the name will be problematic.

        I improved javadocs, to explain better what OrdinalPolicy and PathPolicy are, and the purpos of each of the new instances.

        All tests pass, I think this is ready to commit.

        Show
        Shai Erera added a comment - Patch removes DefaultOrdinalPolicy in favor OrdinalPolicy.ALL_PARENTS. Also adds OrdPolicy.NO_PARENTS (related to LUCENE-4600 ). In that spirit, I also removed DefaultPathPolicy in favor of PathPolicy.ALL_CATEGORIES. In general, I chose specific names over e.g. DEFAULT_POLICY, because I think that 'default' in the name is bad. E.g., if following the results in LUCENE-4600 we'll decide to change the default policy, the name 'default' in the name will be problematic. I improved javadocs, to explain better what OrdinalPolicy and PathPolicy are, and the purpos of each of the new instances. All tests pass, I think this is ready to commit.
        Hide
        Shai Erera added a comment -

        Committed changes to trunk and 4x.

        Show
        Shai Erera added a comment - Committed changes to trunk and 4x.
        Hide
        Commit Tag Bot added a comment -

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

        LUCENE-4604: Implement OrdinalPolicy.NO_PARENTS

        Show
        Commit Tag Bot added a comment - [trunk commit] Shai Erera http://svn.apache.org/viewvc?view=revision&revision=1419521 LUCENE-4604 : Implement OrdinalPolicy.NO_PARENTS
        Hide
        Commit Tag Bot added a comment -

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

        LUCENE-4604: Implement OrdinalPolicy.NO_PARENTS

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Shai Erera http://svn.apache.org/viewvc?view=revision&revision=1419524 LUCENE-4604 : Implement OrdinalPolicy.NO_PARENTS

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development