[ 
https://issues.apache.org/jira/browse/LUCENE-4565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13511320#comment-13511320
 ] 

Shai Erera commented on LUCENE-4565:
------------------------------------

bq. The notion of youngestChild and olderSibling is important. I would not have 
removed the 'older/youngest' parts. Especially not from the TaxoArray's AP

I thought that it's over-verbosing to put them in the method names. Rather, I 
think that good javadocs are what's needed here. It's an API that one reads one 
time usually.

bq. In DirectoryTaxonomyWriter, the loop over the termEnums had been changed to 
"reuse" the TermsEnum and DocsEnum - only they are not reused.

They are reused. Look at the calls below - according to the javadocs, passing 
the TermsEnum/DocsEnum to the respective methods reuses them.

{code}
termsEnum = terms.iterator(termsEnum);
and
docs = termsEnum.docs(null, docs, 0 /* freqs not required */);
{code}
                
> Simplify TaxoReader ParentArray/ChildrenArrays
> ----------------------------------------------
>
>                 Key: LUCENE-4565
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4565
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/facet
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>            Priority: Minor
>         Attachments: LUCENE-4565.patch
>
>
> 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:
> {code}
> int[] parents = taxoReader.getParentArray();
> int[] youngestChilds = taxoReader.getChildrenArrays().getYoungestChildArray();
> int[] olderSiblings = taxoReader.getChildrenArrays().getOlderSiblingArray();
> {code}
> one would make these calls:
> {code}
> int[] parents = taxoReader.getParentInfo().parents();
> int[] youngestChilds = taxoReader.getParentInfo().youngestChilds();
> int[] olderSiblings = taxoReader.getParentInfo().olderSiblings();
> {code}
> Not a big change, just consolidate more code into one logical place. All of 
> these arrays will continue to be lazily allocated.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to