Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 35766 invoked from network); 26 Dec 2007 17:13:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Dec 2007 17:13:37 -0000 Received: (qmail 30402 invoked by uid 500); 26 Dec 2007 17:13:20 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 30369 invoked by uid 500); 26 Dec 2007 17:13:20 -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 30358 invoked by uid 99); 26 Dec 2007 17:13:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2007 09:13:20 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zhouqi.jackson@gmail.com designates 209.85.128.186 as permitted sender) Received: from [209.85.128.186] (HELO fk-out-0910.google.com) (209.85.128.186) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Dec 2007 17:12:56 +0000 Received: by fk-out-0910.google.com with SMTP id z23so2866676fkz.5 for ; Wed, 26 Dec 2007 09:12:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=WKhlm2z8f12nSImWl3coyOoQjw45ncU8mlxpxecim3o=; b=v4e2+E84LKB9gf3SU1rSqFDNPzEpz0ZdlQE47EpExfGi0dg2niLKrw9y5/82KvVjvXVel99Y/1ZWkRPF84FGtC70uQVGw0imz5KwOsH6lszRJ3X32UwAvnwHCq5LvLJRR7qxadXlCr7Lp69Tuy2z4hLcQ/OdsNt1jif7n2isZoc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=KLGC6UaPbr9EM4Xbqm0PJH2MM4fYsbrH4WU8pwPJ56wG1I7wfmkeJAvNo0kqUohARN1EuS3FhlsarwP/2FBcSubQM2i1e7JT56kqa7eLOzmxZSSjIvPSBlrOi3Hw6RZvAvkQfKCRU2uwDL4wOMq/BA2P1sIW6WBNAWR/LvbT3lI= Received: by 10.82.116.15 with SMTP id o15mr12812814buc.3.1198689179150; Wed, 26 Dec 2007 09:12:59 -0800 (PST) Received: by 10.82.151.11 with HTTP; Wed, 26 Dec 2007 09:12:59 -0800 (PST) Message-ID: <72d748c20712260912v5841764bp29bf37c73d69db69@mail.gmail.com> Date: Thu, 27 Dec 2007 01:12:59 +0800 From: "Zhou Qi" To: java-user@lucene.apache.org Subject: Re: Pagination ... In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9079_29901674.1198689179120" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_9079_29901674.1198689179120 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Using the search function for pagination will carry out unnecessary index search when you are going previous or next. Generally, most of the information need (e.g 80%) can be satisfied by the first 100 documents (20%). In lucene, the returing documents is set to 100 for the sake of speed. I am not quite sure my way of pagination is best: but it works fine under test preasure: Just keep the first search result in cache and fetch the snippet when the document is presented in current page. 2007/12/26, Dragon Fly : > > > Any advice on this? Thanks. > > > From: dragon-fly999@hotmail.com > > To: java-user@lucene.apache.org > > Subject: Pagination ... > > Date: Sat, 22 Dec 2007 10:19:30 -0500 > > > > > > Hi, > > > > What is the most efficient way to do pagination in Lucene? I have always > done the following because this "flavor" of the search call allows me to > specify the top N hits ( e.g. 1000) and a Sort object: > > > > TopFieldDocs topFieldDocs = searcher.search(query, null, 1000, > SORT_BY_DATE); > > > > Is it the best way? Thank you. > > > > _________________________________________________________________ > > Don't get caught with egg on your face. Play Chicktionary! > > http://club.live.com/chicktionary.aspx?icid=chick_wlhmtextlink1_dec > > _________________________________________________________________ > Get the power of Windows + Web with the new Windows Live. > http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_122007 ------=_Part_9079_29901674.1198689179120--