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

Boaz Leskes commented on LUCENE-5157:
-------------------------------------

Hi,

Sorry for the delay. I think it's a good idea to separate the push for a more 
generic class. Until the point that is done and properly documented, I would 
opt for clear naming in the current context. The class is marked both internal 
and experimental, so backward compatibility issues shouldn't be a problem in 
the future (if I understand the policies correctly). 

If I understand the suggestion correctly, this is how the getSegmentOrd should 
look like:

{code}
    public long getSegmentOrd(int segment, long globalOrd) {
       assert segment == getFirstSegmentNumber(globalOrd);
       return globalOrd - globalOrdDeltas.get(globalOrd);
    }
{code}

In my opinion this is not an ideal situation because the name and the signature 
suggest you can get a per segment/subindex ordinal for any segment only in 
runtime to fire an assertion (if enabled). My vote would go to communicate the 
functionality better in the name and not offer a segment parameter that is can 
only have one value. 




                
> Refactoring MultiDocValues.OrdinalMap to clarify API and internal structure.
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-5157
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5157
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Boaz Leskes
>            Assignee: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-5157.patch
>
>
> I refactored MultiDocValues.OrdinalMap, removing one unused parameter and 
> renaming some methods to more clearly communicate what they do. Also I 
> renamed subIndex references to segmentIndex.

--
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