apache / apache/lucene

Change naming of variables/apis from docid to docnum [LUCENE-7453]

Open
#8,505 30 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Major type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

In [SOLR-9528](https://issues.apache.org/jira/browse/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.

---
Migrated from [LUCENE-7453](https://issues.apache.org/jira/browse/LUCENE-7453) by Ryan Ernst (@rjernst), 1 vote, updated Oct 04 2016

Contributor guide

Open the contributing guide

Research direction

Start by searching the Lucene APIs and variables for the `docid` name and read the surrounding definitions and callers. Determine the complete scope of the terminology change, then verify that the affected APIs, callers, and existing checks consistently use `docnum` without changing its segment-local meaning.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.