Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 77681 invoked from network); 21 Jul 2005 20:20:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jul 2005 20:20:49 -0000 Received: (qmail 43560 invoked by uid 500); 21 Jul 2005 20:20:34 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 43503 invoked by uid 500); 21 Jul 2005 20:20:34 -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 43473 invoked by uid 99); 21 Jul 2005 20:20:34 -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 13:20:34 -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 13:20:27 -0700 Received: by ehatchersolutions.com (Postfix, from userid 504) id 9569213E2005; Thu, 21 Jul 2005 16:20:30 -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 D06CD13E2005 for ; Thu, 21 Jul 2005 16:20:12 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v730) In-Reply-To: <8a484a780507211243791da55f@mail.gmail.com> References: <8a484a7805072108533a1d1d45@mail.gmail.com> <7C8F343C-774F-487C-8B0E-C108CA943319@ehatchersolutions.com> <8a484a780507211243791da55f@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <88EA1632-D940-4E37-B5CD-63266F77E5AC@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Add unique id to a doc Date: Thu, 21 Jul 2005 16:20:11 -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.7 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 On Jul 21, 2005, at 3:43 PM, Riccardo Daviddi wrote: > What I want to to is to assign a unique id to each doc I add to the > index. > I was wondering if there is a method to assign a unique id directly > looking in the index so after I could store my doc in a db with the > same id as key. So first Lucene, then the DB? How about generating a GUID for each document? Or perhaps a digest of it's contents? Erik > > On 7/21/05, Erik Hatcher wrote: > >> 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 >> >> >> > > > -- > 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