lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <>
Subject Re: What is the maximum document number?
Date Sun, 03 Jun 2012 20:09:06 GMT
The javadoc for IR.maxDoc refers to “largest possible document number”, but the word “possible”
is confusing. Superficially it sounds like the largest document number that Lucene can ever
assign, but really it is simply the “largest document number in the index at the moment,
including deleted documents.”

The javadoc should probably simply say: numDocs = maxDocs - numDeletedDocs

-- Jack Krupansky

From: Uwe Schindler 
Sent: Sunday, June 03, 2012 3:47 PM
Subject: Re: What is the maximum document number?


In fact maxDoc is not the maximum, it is also a count. If no deletions are in an index, maxDoc==numDocs.
That's unfortunately how it is, maybe we should rename that in 4.0.

Uwe Schindler
H.-H.-Meier-Allee 63, 28213 Bremen

Jack Krupansky <> schrieb: 
  Doing a little more research on document numbers, I had thought that the maximum document
number was 2^30-1 or Integer.MAX_INT, but... I see that IndexReader.numDocs, maxDoc, and the
corresponding IndexWriter methods return the number of documents as an int, so since document
numbers start at zero, the number of documents is actually limited to 2^30-1, so the highest
document number is limited to 2^30-1 minus another 1 or 2^30-2.

  -- Jack Krupansky
View raw message