Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 49845 invoked from network); 18 Aug 2010 11:51:23 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Aug 2010 11:51:23 -0000 Received: (qmail 72658 invoked by uid 500); 18 Aug 2010 11:51:21 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 72294 invoked by uid 500); 18 Aug 2010 11:51:18 -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 72286 invoked by uid 99); 18 Aug 2010 11:51:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Aug 2010 11:51:17 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anshumg@gmail.com designates 74.125.82.48 as permitted sender) Received: from [74.125.82.48] (HELO mail-ww0-f48.google.com) (74.125.82.48) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Aug 2010 11:51:13 +0000 Received: by wwb34 with SMTP id 34so88983wwb.5 for ; Wed, 18 Aug 2010 04:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=5yaxYgWg5Qxn0mRfvEawao4E2X1ozGCLkIKKhhD6ZYY=; b=szoTxb49KtF7mluxCGYWAIqDALFBPk7zjV1u4gdbM86mw5HMJnd1Rr8/4eqQPizhEl xHy3trIZiigjf+apZVbI+Z8g7iYctuSrT+ebbeORkfi9cL5QZJ4rdqR9dzRwOZ10Wb9U JS22p9prfjp/hTEfvRAPwOnGvz78kel8zWWE0= 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=qD7l5Khl4PWcgAOcYsa7TfRVpS6QypKp1Jgnxjr+qeoREQMR9kswoBTdXq8fFmuC5V 3sqOFD5wDwYzuqbXOkGst4CrMypFe7HIygpJ7Eq2AauAk5qGFPiMxUdu9RlI/qi+/OkU HvkVBs+nRbJr+uyJxwZoDkwCKQ1MaeBRrwkII= Received: by 10.227.144.2 with SMTP id x2mr7018425wbu.76.1282132251496; Wed, 18 Aug 2010 04:50:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.132.17 with HTTP; Wed, 18 Aug 2010 04:50:31 -0700 (PDT) In-Reply-To: References: From: Anshum Date: Wed, 18 Aug 2010 17:20:31 +0530 Message-ID: Subject: Re: Sorting a Lucene index To: java-user@lucene.apache.org Content-Type: multipart/alternative; boundary=001636832eba67dc4b048e17ada5 --001636832eba67dc4b048e17ada5 Content-Type: text/plain; charset=ISO-8859-1 Hi Shelly, The search results so returned are sorted either by relevance, index order, stored field, or custom order. As you are saying that you would not be able to maintain the index order, you would have to do the sort at run time. Sorting on a stored field is not costly and you may use it comfortably. btw, are you facing any issues in sort time or is it a presumption? -- Anshum Gupta http://ai-cafe.blogspot.com On Wed, Aug 18, 2010 at 5:12 PM, Shelly_Singh wrote: > Hi, > > I have a Lucene index that contains a numeric field along with certain > other fields. The order of incoming documents is random and un-predictable. > As a result, while creating an index, I end up adding docs in random order > with respect to the numeric field value. > > For example, documents may be added in following order: > 12,y,d > 100,o,p > 1,x,y > 23,u,i > 31,v,m > 22,b,m > 109,k,l > > My requirement is that at search time, I want the documents in order of the > numeric field. > One, option is to do a score/sort on the numeric field. > But, this may be a costly operation. > > Hence, I am trying to find if there is some way, such that, my stored index > is sorted by itself. > > Please help. > > Thanks and Regards, > > Shelly Singh > Center For KNowledge Driven Information Systems, Infosys > Email: shelly_singh@infosys.com > Phone: (M) 91 992 369 7200, (VoIP)2022978622 > > > > --001636832eba67dc4b048e17ada5--