Lucene - Core
  1. Lucene - Core
  2. LUCENE-4565

Simplify TaxoReader ParentArray/ChildrenArrays

    Details

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

      Description

      TaxoReader exposes two structures which provide information about a categories parent/childs/siblings: ParentArray and ChildrenArrays. ChildrenArrays are derived (i.e. created) from ParentArray.

      I propose to consolidate all that into one API ParentInfo, or CategoryTreeInfo (a better name?) which will provide the same information, only from one object. So instead of making these calls:

      int[] parents = taxoReader.getParentArray();
      int[] youngestChilds = taxoReader.getChildrenArrays().getYoungestChildArray();
      int[] olderSiblings = taxoReader.getChildrenArrays().getOlderSiblingArray();
      

      one would make these calls:

      int[] parents = taxoReader.getParentInfo().parents();
      int[] youngestChilds = taxoReader.getParentInfo().youngestChilds();
      int[] olderSiblings = taxoReader.getParentInfo().olderSiblings();
      

      Not a big change, just consolidate more code into one logical place. All of these arrays will continue to be lazily allocated.

        Activity

        Shai Erera created issue -
        Shai Erera made changes -
        Field Original Value New Value
        Attachment LUCENE-4565.patch [ 12556266 ]
        Shai Erera made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Lucene Fields New [ 10121 ] New,Patch Available [ 10121, 10120 ]
        Fix Version/s 4.1 [ 12321140 ]
        Fix Version/s 5.0 [ 12321663 ]
        Resolution Fixed [ 1 ]
        Steve Rowe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development