Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 35111 invoked from network); 24 May 2007 20:06:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 May 2007 20:06:18 -0000 Received: (qmail 87798 invoked by uid 500); 24 May 2007 20:06:16 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 87748 invoked by uid 500); 24 May 2007 20:06:16 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 87728 invoked by uid 99); 24 May 2007 20:06:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2007 13:06:16 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of erickerickson@gmail.com designates 209.85.134.186 as permitted sender) Received: from [209.85.134.186] (HELO mu-out-0910.google.com) (209.85.134.186) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 May 2007 13:06:10 -0700 Received: by mu-out-0910.google.com with SMTP id g7so553456muf for ; Thu, 24 May 2007 13:05:48 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Ma6epZ/pxf9QpwQaOswF4/ViBgfU9hw/AfSDdzrq1DMoukETPZxs/lCP9nqYVcdhvqT3lD9TLmTg24VC1Q0Z92p+9Wpw4Xk7Q5VSmp4/hF/CGNL3iIUqw700Gyzj73V2t0lfP4WQjWf2xycGZVgBnEVTY8mCUAll9Mtbp9HjvjE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=FqY+BR9NS4hqBBIks/GI6eTjwQkZtJkR5N7OnbWSUksXBp4fTY1fH45t+YztV7wN7kwzZ4vU0hUtKXxNTwRyKWst0jFQanFTupLefYi3ykC/0UO6F42UIC7sTrBvsDk1u953jwM6+6pR9wQRitJMzSJc+cdjVZyIv+zdlUc9wNk= Received: by 10.82.191.3 with SMTP id o3mr4003179buf.1180037148335; Thu, 24 May 2007 13:05:48 -0700 (PDT) Received: by 10.82.190.7 with HTTP; Thu, 24 May 2007 13:05:48 -0700 (PDT) Message-ID: <359a92830705241305h2aa4cd85pea7fde5b28c5213e@mail.gmail.com> Date: Thu, 24 May 2007 16:05:48 -0400 From: "Erick Erickson" To: java-user@lucene.apache.org Subject: Re: maxDoc and arrays In-Reply-To: <7798eaa0705241130q2258caf5rd2d5486c1f6afa66@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_87585_21143010.1180037148306" References: <7798eaa0705240941y5b420dd3sb2867ed86008dc19@mail.gmail.com> <359a92830705241025t583bb657jbde1a1776bc1546a@mail.gmail.com> <7798eaa0705241130q2258caf5rd2d5486c1f6afa66@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_87585_21143010.1180037148306 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Document IDs will be re-utilized, after, say, optimization. One consequence of this is that optimization will change the IDs of *existing* documents. You're right, that numdocs may well be shorter than maxdocs. That's what I get for reading quickly... Best Erick On 5/24/07, Carlos Pita wrote: > > > > > > > No. It will always be at least as large as the total documents. But that > > will also count deleted documents. > > > > Do you mean that deleted document ids won't be reutilized, so the index > maxDoc will grow more and more with time? Isn't there any way to compress > the range? It seems strange to me, considering that an example in the book > suggests to use the document id as an array index for an array of maxDoc > elements. > > Cheers, > Carlos > > Why wouldn't numdocs serve? > > > > Best > > Erick > > > > > > The motivation of this question is that I want to associate some info to > > > each document in the index, and in order to access this additional > data > > in > > > O(1) I would like to do this through an array indexing. But the array > > size > > > shouldn't be a lot greater than the total number of documents. I see > > that > > > something similar is done in the example of section 6.1 of Lucene in > > > Action, > > > but for sorting purposes, which is not my case. > > > > > > Related to this: how can update my array of extra data when documents > > are > > > added/removed to/from the index? Is there any feedback mechanism by > > means > > > of > > > callbacks or event handlers? > > > > > > Thank you in advance. > > > Regards, > > > Carlos > > > > > > ------=_Part_87585_21143010.1180037148306--