Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 44076 invoked from network); 1 Oct 2009 12:31:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Oct 2009 12:31:41 -0000 Received: (qmail 67934 invoked by uid 500); 1 Oct 2009 12:31:38 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 67853 invoked by uid 500); 1 Oct 2009 12:31:38 -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 67843 invoked by uid 99); 1 Oct 2009 12:31:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2009 12:31:38 +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 (nike.apache.org: domain of anshumg@gmail.com designates 209.85.222.173 as permitted sender) Received: from [209.85.222.173] (HELO mail-pz0-f173.google.com) (209.85.222.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2009 12:31:28 +0000 Received: by pzk3 with SMTP id 3so111975pzk.20 for ; Thu, 01 Oct 2009 05:31:07 -0700 (PDT) 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 :from:date:message-id:subject:to:content-type; bh=sTN9b0kSeyh8yflABk0Ph45BcJQwdcFBCkcEisQuvj0=; b=GphfOeG7FXdB14ZEtU81VgRUQymvIGg10FlpqPvZow2jfMe0S0Z9IBTMOH35oFtkz6 gkULC17JFDbRMIXaccwMd1RcJcmQyIigfTAmqShBVnkVUHuwwBGK3NcpsE/uNikT7REs ja0M+krE3Uxkas7Sg8HHX6A5AUzW76GRyNcRg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=I3GcZllVfp7NwlYO4SJVAOi8NH1pyzLiEGtwa/ooNgoTLoGbC15afBdI2HNf+jKxzc 1qQ0vxLxc+KkhlOFMunL5Td24Hm19C3Gi7M26hp2oJrFfA/nJLUzqsTqZRymItnMRRZ/ Y1xq8A0XY8AjF0Wuggf6/GcTHdHx32L2VzUcg= MIME-Version: 1.0 Received: by 10.115.24.3 with SMTP id b3mr1966727waj.23.1254400267147; Thu, 01 Oct 2009 05:31:07 -0700 (PDT) In-Reply-To: <4AC49B8B.200@arcor.de> References: <4AC48FB3.2080403@arcor.de> <867513fe0910010443w5ea01c16r1341c885bde68c46@mail.gmail.com> <4AC49B8B.200@arcor.de> From: Anshum Date: Thu, 1 Oct 2009 18:00:47 +0530 Message-ID: <867513fe0910010530q1648626ob5bd92bb7dc3aaf8@mail.gmail.com> Subject: Re: Pagination and Sorting To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=00163646b678545e3f0474ded264 X-Virus-Checked: Checked by ClamAV on apache.org --00163646b678545e3f0474ded264 Content-Type: text/plain; charset=ISO-8859-1 @Christian : Which version of Lucene are you using? For lucene 2.9 this would work. *__code snippet__* IndexReader r = IndexReader.open("/home/anshum/index/indexname", true); IndexSearcher s = new IndexSearcher(r); QueryParser qp = new QueryParser("testfield",new StopAnalyzer()); Query q = qp.parse("test query"); int offset = 10000; int limit = 100; Sort sort = new Sort(new SortField("testfield",SortField.DOUBLE));* // You may want to change field type to something else* TopFieldCollector c = TopFieldCollector.create(sort, offset+limit, true, true, true, true); s.search(q, c); for(int i=offset;i wrote: > Anshum, > > > You could get the hits in a collector and pass the sort to the > > collector as it would be the collect function that handles the > > sorting. > > > > searcherObject.search(query,collector); > > > > Hope that gives you some headway. :) > > Not quite (yet?) ;-) > > What do you mean by passing the Sort to the collector as collect > function? Could you provide a little code snippet that describes > the procedure? > > Thanks! > Chris > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > --00163646b678545e3f0474ded264--