Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 99453 invoked from network); 21 Jul 2005 17:19:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jul 2005 17:19:47 -0000 Received: (qmail 33054 invoked by uid 500); 21 Jul 2005 17:19:41 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 33032 invoked by uid 500); 21 Jul 2005 17:19:41 -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 33019 invoked by uid 99); 21 Jul 2005 17:19:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2005 10:19:41 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [69.55.225.129] (HELO ehatchersolutions.com) (69.55.225.129) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2005 10:19:35 -0700 Received: by ehatchersolutions.com (Postfix, from userid 504) id C260B13E2008; Thu, 21 Jul 2005 13:19:36 -0400 (EDT) Received: from [128.143.167.108] (d-128-167-108.bootp.Virginia.EDU [128.143.167.108]) by ehatchersolutions.com (Postfix) with ESMTP id 9936A13E2006 for ; Thu, 21 Jul 2005 13:18:57 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v730) In-Reply-To: <8a484a7805072108533a1d1d45@mail.gmail.com> References: <8a484a7805072108533a1d1d45@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <7C8F343C-774F-487C-8B0E-C108CA943319@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Add unique id to a doc Date: Thu, 21 Jul 2005 13:18:53 -0400 To: java-user@lucene.apache.org X-Mailer: Apple Mail (2.730) X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on javelina X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N You could certainly use IndexReader to get the last document in the index and retrieve its ID, but why? What use case do you have in mind for such id's? Do they have a non- arbitrary meaning? Do your documents have nothing unique to identify them already? Erik On Jul 21, 2005, at 11:53 AM, Riccardo Daviddi wrote: > Hi all, > > it's possible to set an unique id (as keyword field) to a doc by > looking in the index? I mean, it's possible to look in the index and > know what is the last id (which is a keyword field) and then decide > for the new id to associate to the new indexed doc? Or it's better > store the doc in a db and get so a unique id (the key of the row in > the db) and use it as the unique id for the keyword field in the > index? > > -- > Riccardo Daviddi > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org