Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-4604

Implement OrdinalPolicy.NO_PARENTS

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.1, 6.0
    • modules/facet
    • None
    • 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).

      Attachments

        1. LUCENE-4604.patch
          16 kB
          Shai Erera

        Activity

          People

            shaie Shai Erera
            shaie Shai Erera
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: