Adrien Grand commented on LUCENE-7453:

bq. When you think of documents inside a reader as a contiguous "array" of 
documents, the index makes a lot of sense

+1 to this point, this is the analogy I always make in order to explain doc 
ids. I like moving to a name that suggests that the doc id is an index rather 
than an identifier.

Regarding the class renaming, even though these are expert/low-level classes, I 
agree it'd be nicer to do the renaming in a major release since everybody who 
has low-level integration with Lucene probably messes up with the 
DocIdSetIterator class. Unless maybe we can figure a way to make the migration 
easier by either making DocIndexIterator (or whatever the new name would be) a 
parent or sub class of DocIdSetIterator and deprecating DocIdSetIterator?

> 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