Paul Elschot commented on LUCENE-7453:

I tried an alternative that adds an variation of segment wherever docID is used 
in some form.

Here is an overview of renaming possibilities for core/src/java, in three 
column python strings.

The first column contains the current name, the second column a segment 
variant, the third column an index variant.
Please assume an appropriate amount of question marks (??) in the second and 
third columns.

classFileRenames = """

DocIdSet                     SegDocIdSet                          DocIndexSet
DocIdSetIterator             SegDocIdSetIterator                  
ConjunctionDISI              ConjunctionSegDisi                   
DisjunctionDISIApproximation DisjunctionSegDisiApproximation      
DisiPriorityQueue            SegDisiPriorityQueue                 
DisiWrapper                  SegDisiWrapper                       DixiWrapper
FilteredDocIdSetIterator     FilteredSegDisi                      FilteredDixi
DocIdSetBuilder              SegDocIdSetBuilder                   
RoaringDocIdSet              RoaringSegDocIdSet                   
IntArrayDocIdSet             IntArraySegDocIdSet                  
NotDocIdSet                  NotSegDocIdSet                       NotDocIndexSet
BitDocIdSet                  BitSegDocIdSet                       BitDocIndexSet
DocIdsWriter                 SegDocIdsWriter                      
DocIdMerger                  SegDocIdMerger                       DocIndexMerger

identifierRenames = classFileRenames + """

TwoPhaseIteratorAsDocIdSetIterator TwoPhaseIteratorAsSegDocIdSetIterator 
BitSetConjunctionDISI              BitSetConjunctionDisi                 
IntArrayDocIdSetIterator           IntArraySegDocIdSetIterator           

asDocIdSetIterator                 asSegDocIdSetIterator                 
getDocId                           getSegDocId                           
docID                              sdocID                                

docID                              sdocID                                docIdx
docId                              sdocId                                docIdx
docIDs                             sdocIDs                               docIdxs
docIds                             sdocIds                               docIdxs
disi                               sdisi                                 dixi
docIdSet                           sDocIdSet                             


(The identifiers here are for local classes, methods and variables.)

I don't like overloading index for this, especially in the class names, so for 
now I'd prefer the segment variants in second column.

Anyway, we could use the opportunity to shorten some of the longer names.

> Change naming of variables/apis from docid to docnum
> ----------------------------------------------------
>                 Key: LUCENE-7453
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7453
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Ryan Ernst
> In SOLR-9528 a suggestion was made to change {{docid}} to {{docnum}}. The 
> reasoning for this is most notably that {{docid}} has a connotation about a 
> persistent unique identifier (eg like {{_id}} in elasticsearch or {{id}} in 
> solr), while {{docid}} in lucene is currently some local to a segment, and 
> not comparable directly across segments.
> When I first started working on Lucene, I had this same confusion. {{docnum}} 
> is a much better name for this transient, segment local identifier for a doc. 
> Regardless of what solr wants to do in their api (eg keeping _docid_), I 
> think we should switch the lucene apis and variable names to use docnum.

This message was sent by Atlassian JIRA

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

Reply via email to