Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 61061 invoked from network); 7 Dec 2008 00:22:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2008 00:22:45 -0000 Received: (qmail 36084 invoked by uid 500); 7 Dec 2008 00:22:52 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 36054 invoked by uid 500); 7 Dec 2008 00:22:52 -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 36043 invoked by uid 99); 7 Dec 2008 00:22:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Dec 2008 16:22:51 -0800 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 (athena.apache.org: domain of tshivaraj@gmail.com designates 66.249.90.181 as permitted sender) Received: from [66.249.90.181] (HELO ik-out-1112.google.com) (66.249.90.181) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Dec 2008 00:21:22 +0000 Received: by ik-out-1112.google.com with SMTP id c29so468980ika.5 for ; Sat, 06 Dec 2008 16:21: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=tIkyyNNez1TWFosCHf6yyCf8kRFzCXMiUvgzOHHJM1I=; b=Ku7XXfhVPUWvDtxrpSUHxsbpRYmRIZ/tYypbAaOJCrFYKyCykMTH3yAUK94ltiGmrf E7cLLsf4PqFr8PouD6CPqSzm46cpoAilGN4z6M3+0QNTnOWeyHAXWskaa2q7DHIAatB0 ceHFrGvuL7SWFHzq2Qn/WVU+xH9wI4E4bTKTk= 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=LcZ9TDH4KX7wf9l3g4TNlqkdqO92L7vzfp1LCtW2H3UJGXXkZ+7CavzJCPMkU3E/LW uab5PExujZbkHiqY6WGoB6EzWMmkm7mdHwX7R61cLUxXuFSa7wN4CGKlM/VVNnAZk0gq bU/FMfsQ9P+8nnzcRB18aHqEzgr+uh1vri+38= Received: by 10.210.46.4 with SMTP id t4mr1819538ebt.49.1228609319676; Sat, 06 Dec 2008 16:21:59 -0800 (PST) Received: by 10.210.82.10 with HTTP; Sat, 6 Dec 2008 16:21:59 -0800 (PST) Message-ID: <4950afc10812061621m1e2ee730y756a676b74ff2cec@mail.gmail.com> Date: Sat, 6 Dec 2008 19:21:59 -0500 From: "Shivaraj Tenginakai" To: java-user@lucene.apache.org Subject: Re: Sorting documents without a query In-Reply-To: <8837fb770812050135l1faf55b8jbe2354cdd89511d3@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_58685_29016135.1228609319647" References: <4950afc10812042312i1ab36d1bi9d059d991e0fb47b@mail.gmail.com> <8837fb770812050135l1faf55b8jbe2354cdd89511d3@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_58685_29016135.1228609319647 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks John, MatchAllDocsQuery works, however I was unable to locate an example for traversing the term table. Could you please point me to one? Regards, Shivaraj On Fri, Dec 5, 2008 at 4:35 AM, John Wang wrote: > The obvious way is to use use MatchAllDocsQuery with Sort parameters on the > searcher, e.g. > > searcher.search(new MatchAllDocsQuery(),sort); > > If you only care about 1 sort spec (e.g. no secondary sort to break ties) > it > may be faster just traversing the term table since that is already sorted. > > -John > > On Thu, Dec 4, 2008 at 11:12 PM, Shivaraj Tenginakai >wrote: > > > I have a usecase in which I have no search query, but still need to sort > > documents. For example, items need to be sorted by price, though the user > > has not yet selected any search criteria. > > > > What would be the best way to achieve this? > > > > Thanks and Regards, > > > > Shivaraj > > > ------=_Part_58685_29016135.1228609319647--