From java-user-return-35382-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Thu Aug 07 16:38:10 2008 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 25885 invoked from network); 7 Aug 2008 16:38:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Aug 2008 16:38:09 -0000 Received: (qmail 24273 invoked by uid 500); 7 Aug 2008 16:38:03 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 24234 invoked by uid 500); 7 Aug 2008 16:38:03 -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 24223 invoked by uid 99); 7 Aug 2008 16:38:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 09:38:02 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yseeley@gmail.com designates 64.233.166.182 as permitted sender) Received: from [64.233.166.182] (HELO py-out-1112.google.com) (64.233.166.182) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Aug 2008 16:37:07 +0000 Received: by py-out-1112.google.com with SMTP id z74so376216pyg.9 for ; Thu, 07 Aug 2008 09:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=86s7pVomI2jRWzpcjb4V1GDQCY8OUK2UNgN4wrwW9yM=; b=IUNWJXLooRltZf08IpTuc6jqEqYI0Tt9rjPyoZpmWTzcjMh/xtjBHVP16c0ySuaBMe RLqhghB8BqlOUG8cOESXa3zcAMO9nOVz0cV2Qx0vNh2DCBhwEJnAPmfuc6bOt8vCWYHa IwdtjXYyoXc0sLHn1ceGYiZqwWfSgTJakBGSE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=s1ODAbhm0nEYsQftEU3EZhej6W7zjyrsLFSAf0jdfyLnSyuQLWrBkB2WAAOO2UaKZN 0cPMhJq/G8/Lu5S8qzcfBd+p3uZwhKMmMbKaBcLTFiNQu8DLH8VnOrzG9c/mXAb1XpFE TaSVyLH3Fr7ybii2OjBwB3CJf5s5NvHBqUKwo= Received: by 10.141.29.18 with SMTP id g18mr790238rvj.298.1218127036348; Thu, 07 Aug 2008 09:37:16 -0700 (PDT) Received: by 10.140.172.6 with HTTP; Thu, 7 Aug 2008 09:37:16 -0700 (PDT) Message-ID: Date: Thu, 7 Aug 2008 12:37:16 -0400 From: "Yonik Seeley" Sender: yseeley@gmail.com To: java-user@lucene.apache.org Subject: Re: Paging & Sorting In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Google-Sender-Auth: d409c62bdadfc748 X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Aug 7, 2008 at 11:57 AM, Neeraj Gupta wrote: > A Gentle Reminder! Any Solution around this problem? Lucky you, it's already been solved :-) Seriously though, I think you are making some incorrect assumptions about how Lucene works. Lucene does not retrieve all 50K documents... but it does *score* those documents and only keeps track of the top ones (by id), and then only retrieves the whole document for only those you ask for. -Yonik > Regards > -Neeraj > > > > > Thank you for the reply, As you said > > Sure, just iterate over the first 100 entries in your Hits object > > It means before Iteration Lucene has already spent time and memory in > finding all the 50k documents and sorting them, then i will retrieve 100 > documents. Hence it is costing me a search for 50k documents + sorting of > these 50k matching documents + retrieval of first 100 documents.. Right? > > But what i want is the way, to get the same result as per the above > process but with not costing me to search and sort all 50K matching > documents. is this possible? > > Many Thx! > -Neeraj --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org