Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 14131 invoked from network); 9 Feb 2010 17:41:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2010 17:41:38 -0000 Received: (qmail 87602 invoked by uid 500); 9 Feb 2010 17:41:36 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 87524 invoked by uid 500); 9 Feb 2010 17:41:36 -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 87513 invoked by uid 99); 9 Feb 2010 17:41:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 17:41:36 +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 (athena.apache.org: domain of erickerickson@gmail.com designates 209.85.219.218 as permitted sender) Received: from [209.85.219.218] (HELO mail-ew0-f218.google.com) (209.85.219.218) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 17:41:29 +0000 Received: by ewy10 with SMTP id 10so5155335ewy.11 for ; Tue, 09 Feb 2010 09:41:08 -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=GGA1wLKYvvcg8fBpGWJZLylvX5kQ4SkoZpMmv2LvxtE=; b=Xr9U9M2Pk7m2xDIPHkrh30D8W5n+mlNK7OWunyMBz74ydk/rvE0qTZQ8rHstW5o2VM uyKjATz7y+CrKNWYpdjHpM9Btkm70hnF8k7g6eZl5lH90YvM84meEtF3iM8DIo5Olk3+ ZhTcYdZqMpfX1lg14Lc+8OsQB34Jpmj41jTxM= 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=cdjvl5xCx/8IoI20DDoV/jDDu2taFzJmdXcKCNrJDaGYV9Hk/eLAdlzb52X+NgzhYv v4Zr1K9V0AfCyna6qgBDJmMdaCSip4mP+JE2vv2yZYtJFhwrar3Fr7NBjwHGPDKgKUsk JtHiwhIaPaevO3sKkE0LVLf5r6Vsjal00xMHw= MIME-Version: 1.0 Received: by 10.216.91.10 with SMTP id g10mr2251519wef.217.1265737267500; Tue, 09 Feb 2010 09:41:07 -0800 (PST) In-Reply-To: <20100209164455.41060@gmx.net> References: <20100209164455.41060@gmx.net> Date: Tue, 9 Feb 2010 12:41:07 -0500 Message-ID: <359a92831002090941se9b40dbk89413d3f731fe28f@mail.gmail.com> Subject: Re: fast Result Count From: Erick Erickson To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=0016e6d77e3c35560c047f2e6c4b --0016e6d77e3c35560c047f2e6c4b Content-Type: text/plain; charset=ISO-8859-1 I'm not sure what you mean by "loading them all into memory". I'm pretty sure that the numHits you specify just limits the number of documents kept in the internal ScoreDocs, and getTotalHits can easily be much greater than numHits. But that would be trivial to test (you shouldn't take my word for this one )... HTH Erick On Tue, Feb 9, 2010 at 11:44 AM, Klaus Teller wrote: > Hi Guys, > > Is there a way to speed up couting documents that satisfy a search query > other than by using TopDocCollector.getTotalHits()? > > For instance, if there are 1000000 documents satisfying my search query, > how can I count them without loading them all in memory? > > Thanks, > Klaus. > -- > Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 > - > sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --0016e6d77e3c35560c047f2e6c4b--