Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 96209 invoked from network); 7 Aug 2005 15:06:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Aug 2005 15:06:49 -0000 Received: (qmail 73286 invoked by uid 500); 7 Aug 2005 15:06:45 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 73249 invoked by uid 500); 7 Aug 2005 15:06:44 -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 73235 invoked by uid 99); 7 Aug 2005 15:06:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Aug 2005 08:06:44 -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; Sun, 07 Aug 2005 08:06:32 -0700 Received: by ehatchersolutions.com (Postfix, from userid 504) id AB9CE13E2007; Sun, 7 Aug 2005 11:06:40 -0400 (EDT) Received: from [172.16.1.101] (va-71-48-138-146.dyn.sprint-hsd.net [71.48.138.146]) by ehatchersolutions.com (Postfix) with ESMTP id 4137413E2006 for ; Sun, 7 Aug 2005 11:06:36 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v730) In-Reply-To: <5f4a646105080704477d6036fe@mail.gmail.com> References: <5f4a646105080704477d6036fe@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <2362AEE4-BA99-49E0-8CBD-EB0FCE9276B8@ehatchersolutions.com> Content-Transfer-Encoding: 7bit From: Erik Hatcher Subject: Re: Count the total # of docs in the index? Date: Sun, 7 Aug 2005 11:06:34 -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=-5.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N You've asked to different questions - you can use IndexReader.numDocs () to find the total number of documents. Within a date range - how did you index the dates? If the dates are in lexicographical order, you can walk all the terms in that range using TermEnum from IndexReader.terms(Term t) where t is the first term in the date range. You will then need to get the termDocs(t) for each of the matching terms. So it is possible without a search. Erik On Aug 7, 2005, at 7:47 AM, Ben wrote: > Hi > > Is it possible to count the total number of documents in the index > without requesting a search? I would like to count the total documents > in the index within a date range. > > Thanks, > Ben > > --------------------------------------------------------------------- > 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