Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 94539 invoked from network); 10 Nov 2005 23:34:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Nov 2005 23:34:28 -0000 Received: (qmail 9625 invoked by uid 500); 10 Nov 2005 23:34:22 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 9593 invoked by uid 500); 10 Nov 2005 23:34:21 -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 9582 invoked by uid 99); 10 Nov 2005 23:34:21 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Nov 2005 15:34:21 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [169.229.70.167] (HELO rescomp.berkeley.edu) (169.229.70.167) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Nov 2005 15:34:13 -0800 Received: by rescomp.berkeley.edu (Postfix, from userid 1007) id 07B8E5B796; Thu, 10 Nov 2005 15:33:55 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by rescomp.berkeley.edu (Postfix) with ESMTP id F2D297F459 for ; Thu, 10 Nov 2005 15:33:55 -0800 (PST) Date: Thu, 10 Nov 2005 15:33:55 -0800 (PST) From: Chris Hostetter Sender: hossman@hal.rescomp.berkeley.edu To: java-user@lucene.apache.org Subject: Re: Search Help In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N : That's what I'm doing now, but I was thinking that if I limit the number of : results I get back, I can save query time. Maybe I'm wrong? one thing that does slightly bug me about the way the Hits class works, is that the constructor (which is called by the Searcher.search(Query) calls getMoreDocs(50) ... which ensures that the first 100 results are cached beore the client has ever said how many results they are interested in. Each call to Hits.doc(x) calls getMoreDocs(x) if x is bigger then the largest doc fetched into the cache. In the past, Another user asked a question regarding the equivilent of paginated searching, where his "pages" had a large number of results (1000 i think) and he was wondering why on page two, both the call to search, and the call to Hits.doc(1001) were taking so long -- it's because the call to search was fetching the first 100 docs, and then the call to Hits.get(1001) was throwing away that info and getting a bunch more. Your situation isn't exactly the same, but it is relatd in the sense that by using Hits, you are getting some under the covers behavior that is targeted at the "common case" and you are not the common case. If you acctaully feel like your performance isn't good enough, and you want to make your code a little more complicated, and start playing with the "Expert" methods, you might want to take a look at this one... http://lucene.apache.org/java/docs/api/org/apache/lucene/search/Searchable.html#search(org.apache.lucene.search.Query,%20org.apache.lucene.search.Filter,%20int) -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org