Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 18597 invoked from network); 14 Feb 2008 12:00:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Feb 2008 12:00:27 -0000 Received: (qmail 72769 invoked by uid 500); 14 Feb 2008 12:00:12 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 72748 invoked by uid 500); 14 Feb 2008 12:00:12 -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 72737 invoked by uid 99); 14 Feb 2008 12:00:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2008 04:00:12 -0800 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 (athena.apache.org: domain of gshankar.sahu@gmail.com designates 72.14.246.245 as permitted sender) Received: from [72.14.246.245] (HELO ag-out-0708.google.com) (72.14.246.245) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Feb 2008 11:59:41 +0000 Received: by ag-out-0708.google.com with SMTP id 23so2177254agd.5 for ; Thu, 14 Feb 2008 03:59:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=ywtLn/UJYZhajT/iOaaKxPllok5DWh15vjzzMn9P+i8=; b=pQYadIB7G11e3teaga8CweE4a7wRbpeGG2fIMiRkaRizcix3rJ7fmDlZTAWJBMYbwa5CZlwrgy3OgCibj6Tr/LdWCE95D5BAevM8/V/C+cMSX7ne4Mat1PiLpsUgZoEXfTMjQMXhUe8/W05u2y778V/FmZ/qDq0/YB8J3WAsIfs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=cl4SExocDZwDj1LvNAVSkeRIlG0jQ2thAh4fqJj5RXTzuStvs2/L7oRk0RKYHxOG7bg+P1+0ziX7RZpM0tkjH0YkXTm5PBLFHof8z2+57d4dA928DBHeM4Lou8E4p8Ob0pFn03QE4qxTKBVFUHRoSOc1HbbgoJAS/tsPkwxSEbY= Received: by 10.100.120.15 with SMTP id s15mr1377927anc.17.1202990388816; Thu, 14 Feb 2008 03:59:48 -0800 (PST) Received: by 10.100.105.4 with HTTP; Thu, 14 Feb 2008 03:59:48 -0800 (PST) Message-ID: <979a94470802140359u50b56129j51c51639c165d865@mail.gmail.com> Date: Thu, 14 Feb 2008 17:29:48 +0530 From: "Gauri Shankar" To: java-user@lucene.apache.org Subject: Re: how to get the programmatic control over index's document id In-Reply-To: <359a92830802090740p3c658ab9qf413b70a3257a859@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_920_24711316.1202990388804" References: <979a94470802090438h67b457dfuabd72e84d6fd7c2f@mail.gmail.com> <359a92830802090740p3c658ab9qf413b70a3257a859@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_920_24711316.1202990388804 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks a lot for both of you. yes, I am talking about internally assigned document id. Erick : I am already using the unique id into the index mapped to one of our DB's primary key to uniquely identify the docs from index. Now to get the value of this unique field i need to call getDocumet(). But when the resultset is too large than this step is very slow as I am calling getDocument for each hit. Now I am using the FIELDCACHE and that has improved a lot. But I am thinking If I can find a way so that docId can be my unique ids and that will super optimize our search. Any suggestions?? Thanks, Gauri Shankar On Sat, Feb 9, 2008 at 9:10 PM, Erick Erickson wrote: > If you're referring to the internally-assigned document id, I don't think > there is a way. Assuming you're trying to assign one yourself or some > such. > > From all the discussions I've seen, I don't think there's even a faint > possibility that controlling this will be added to Lucene. Note that > existing IDs change as your index changes. > > Why do you care? What problem are you trying to solve? One common > suggestion is to create your own field (as Patrick suggests) that contains > your own unique ID. Using TermEnum/TermDocs will give you efficient > ways of going from your unique ID to a docID... > > Best > Erick > > On Feb 9, 2008 7:38 AM, Gauri Shankar wrote: > > > Hi, > > > > I would like to get the control over the docId field from my code. Can > > anyone suggest some way for doing the same? > > > > > > -- > > Warm Regards, > > Gauri Shankar > > > -- Warm Regards, Gauri Shankar ------=_Part_920_24711316.1202990388804--