[ https://issues.apache.org/jira/browse/LUCENE-7453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15513380#comment-15513380 ]
Yonik Seeley commented on LUCENE-7453: -------------------------------------- I don't think changing the name really helps a new user understand what a docid actually is, and the safe ways to use one - that's the much harder part. The fact that it's transient in a sense (but still cacheable for the lifetime of a reader), local to a segment (one has to understand segments and the fact that they are mostly immutable), the fact that you *can* reuse one on a different view of the same segment (deleted docs), etc. This naming discussion would have been appropriate during the initial naming perhaps, but now a rename would inflict guaranteed pain on all existing devs / documentation / books / blogs, ec., all to attempt to safe a few *seconds* of new user confusion out of the necessary *days/weeks* of total confusion necessary to build a mental model of how Lucene actually works. In fact, it may be just as likely to cause confusion if the new user is using any out-of-date resources that use the old terminology. It sounds like a poor trade-off to rename now. > 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 (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org