Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 42742 invoked from network); 26 Nov 2006 08:08:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Nov 2006 08:08:02 -0000 Received: (qmail 55567 invoked by uid 500); 26 Nov 2006 08:08:09 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 55525 invoked by uid 500); 26 Nov 2006 08:08:09 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 55506 invoked by uid 99); 26 Nov 2006 08:08:09 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 00:08:09 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [132.68.238.34] (HELO mailgw1.technion.ac.il) (132.68.238.34) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Nov 2006 00:07:56 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgw1.technion.ac.il (Postfix) with ESMTP id BA20CAC560 for ; Sun, 26 Nov 2006 10:07:33 +0200 (IST) X-Virus-Scanned: by amavisd-new at technion.ac.il Received: from mailgw1.technion.ac.il ([127.0.0.1]) by localhost (mailgw1.technion.ac.il [127.0.0.1]) (amavisd-new, port 10024) with LMTP id prAcuZ-zTnFY for ; Sun, 26 Nov 2006 10:07:33 +0200 (IST) Received: from fermat.math.technion.ac.il (fermat.math.technion.ac.il [132.68.115.6]) by mailgw1.technion.ac.il (Postfix) with ESMTP id 92B27AC536 for ; Sun, 26 Nov 2006 10:07:29 +0200 (IST) Received: from fermat.math.technion.ac.il (localhost [127.0.0.1]) by fermat.math.technion.ac.il (8.12.10/8.12.10) with ESMTP id kAQ87Tr2011529 for ; Sun, 26 Nov 2006 10:07:29 +0200 (IST) Received: (from nyh@localhost) by fermat.math.technion.ac.il (8.12.10/8.12.10/Submit) id kAQ87Qd0011528 for java-dev@lucene.apache.org; Sun, 26 Nov 2006 10:07:26 +0200 (IST) X-Authentication-Warning: fermat.math.technion.ac.il: nyh set sender to nyh@math.technion.ac.il using -f Date: Sun, 26 Nov 2006 10:07:26 +0200 From: "Nadav Har'El" To: java-dev@lucene.apache.org Subject: Re: Controlling Hits Message-ID: <20061126080726.GA10433@fermat.math.technion.ac.il> References: <20061125063805.20518.qmail@web50301.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061125063805.20518.qmail@web50301.mail.yahoo.com> User-Agent: Mutt/1.4.2.2i Hebrew-Date: 5 Kislev 5767 X-Virus-Checked: Checked by ClamAV on apache.org On Fri, Nov 24, 2006, Otis Gospodnetic wrote about "Controlling Hits": > Hi, > > Could we make Hits non-final, or at least expose something in Hits to control the number of Documents it reads from disk? >... > Or maybe the answer is: Use the search method that returns TopDocs if you want more control...? In an application I was writing, I was facing similar issues: "Hits" was fine for a short Demo in Lucene, but when it came to a real application, it didn't give me enough control: it reran the search too many times when you wanted to see, e.g, the 20th result page, and wouldn't allow me adding a HitCollector which I needed. I started by modifying Hits (which wasn't just final - much of its functionality was private), but then realized: there's simply no reason to use Hits! IndexSearcher.search() which returns TopDocs already gives you full control, and frankly isn't that much harder to use. In fact, I fail to see a situation where "Hits"'s concept of "random access" to the results (you can ask for result #30 and then #70) even makes sense. In all search applications I'm familar with, at the time you call search(), you already know how many results you want to display - and you don't need someone to guess for you that you need 50 results, and if that's not enough then you need 100 results, and then 200, and so on. And since this concept of "random access" is what differenciates Hits from TopDocs, perhaps we don't need Hits at all? So, how about deprecating Hits altogether, and recommending the TopDocs alternatives instead? -- Nadav Har'El | Sunday, Nov 26 2006, 5 Kislev 5767 IBM Haifa Research Lab |----------------------------------------- |God created the world out of nothing, but http://nadav.harel.org.il |the nothingness still shows through. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org