Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 64310 invoked from network); 4 Nov 2009 15:10:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Nov 2009 15:10:45 -0000 Received: (qmail 1153 invoked by uid 500); 4 Nov 2009 15:10:43 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 1081 invoked by uid 500); 4 Nov 2009 15:10:43 -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 1071 invoked by uid 99); 4 Nov 2009 15:10:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 15:10:43 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of erickerickson@gmail.com designates 209.85.223.176 as permitted sender) Received: from [209.85.223.176] (HELO mail-iw0-f176.google.com) (209.85.223.176) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 15:10:33 +0000 Received: by iwn6 with SMTP id 6so4702082iwn.20 for ; Wed, 04 Nov 2009 07:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=S3rAMCPpVNDzHjc4Qxby0h/sdd4r9fyYcqZFphhBlS4=; b=AhbbB7FzXLH4xdW/1rEZy8fW/AE5Cgg68y4jrZpgPh1mp8lo9WpOxQldxfz5UKdxyE 8IswH/xtYeIWjX9Ibs6/3+MVIOjj1tXwkRT0nTbz3wwiaZQFLrAh64TVXelE6bejceXh 2gSASwxMVZRODkLBqVnL6gWcaQ7neJMbWicAk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Z8WffOznWNV5cAd8DVgASfLxSMvM4DJyCj34nfhTzouUTwIU9hAGW74Gg5rwrESjlD sZ3UQW3MNmVicLuMVKEgfz+MDQD+/xtn/Pd8mH//iUF75Iw/tdw4f+kiWzrMwC46Mlsc 5QGw1gQAsFxPXWIdt/ILZMCLbGY3j+Xcgtyjo= MIME-Version: 1.0 Received: by 10.231.1.22 with SMTP id 22mr4078168ibd.56.1257347412693; Wed, 04 Nov 2009 07:10:12 -0800 (PST) In-Reply-To: <26197146.post@talk.nabble.com> References: <26197146.post@talk.nabble.com> Date: Wed, 4 Nov 2009 10:10:12 -0500 Message-ID: <359a92830911040710q184fb0fex9c4f7491c6431842@mail.gmail.com> Subject: Re: addIndexesNoOptimize on shards --> is docid deterministic and calculable? From: Erick Erickson To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=00151773eaa0e49f2104778d01ed X-Virus-Checked: Checked by ClamAV on apache.org --00151773eaa0e49f2104778d01ed Content-Type: text/plain; charset=ISO-8859-1 Hmmmm, why do you care? That is, what is it you're trying to do that makes this question necessary? There might be a better solution than trying to depend on doc IDs. Because I don't think you can assume that, even if it is deterministic with the version you're using now that it would be in some other version, Lucene makes no promises here. All the advice I've ever seen says that if you want to keep track of documents, you assign and index your own ID. You can get the doc ID from your unique term quite efficiently if you need to. HTH Erick On Wed, Nov 4, 2009 at 9:23 AM, Britske wrote: > > Hi, > > say I have: > - Indexreader[] readers = {reader1, reader2, reader3} //containing all > different docs > - I know the internal docids of documents in reader1, reader2, reader3 > seperately > > Does doing IndexWriter.addIndexesNoOptimize(Indexreader[] readers) on these > readers give me a determinstic and calculable set of docids on the > documents > in the resulting documentWriter? > > i.e: from http://lucene.apache.org/java/2_4_1/fileformats.html: > "The numbers stored in each segment are unique only within the segment, and > must be converted before they can be used in a larger context. The standard > technique is to allocate each segment a range of values, based on the range > of numbers used in that segment. To convert a document number from a > segment > to an external value, the segment's base document number is added." > > Does assinging docids in addIndexesNoOptimize work like this? > in other words: > - docids of docs in reader1 stay the same in indexwriter > - docids of docs in reader2 are incremented by reader1.docs.size(); > - docids of docs in reader3 are incremented by reader1.docs.size() + > reader2.docs.size() > > Thanks, > Geert-Jan > -- > View this message in context: > http://old.nabble.com/addIndexesNoOptimize-on-shards---%3E-is-docid-deterministic-and-calculable--tp26197146p26197146.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --00151773eaa0e49f2104778d01ed--