karl wettin wrote:
I think the big undertaking would be to refactor all of Lucene to use longs as document numbers.

But not in the store. There it would still be integers, and the MultiReader can keep track of Integer.MAX_VALUE stores. Integer.MAX_VALUE*Integer.MAX_VALUE = Long.MAX_VALUE. So there would not have to be any arrays around with a length greater than Integer.MAX_VALUE?

class SegmentReader extends IndexReader {

+  private int documentNumber(long n) throws IOException {
+    if (n > Integer.MAX_VALUE) {
+ throw new IOException("Max " + Integer.MAX_VALUE + " documents in a Segement!");
+    }
+    return (int)n;
+  }

-  protected void doDelete(int docNum) {
+  protected void doDelete(long longDocNum) {
+    int docNum = documentNumber(longDocNum);

Looks good to me. And of course if someone *wanted* to make an alternative implementation of SegmentReader and the whole storage so that it can support longs internally, they would then be able to.

Daniel


--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to