Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 44475 invoked from network); 2 Mar 2009 16:39:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Mar 2009 16:39:26 -0000 Received: (qmail 82821 invoked by uid 500); 2 Mar 2009 16:39:19 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 82796 invoked by uid 500); 2 Mar 2009 16:39:19 -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 82785 invoked by uid 99); 2 Mar 2009 16:39:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2009 08:39:19 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2009 16:39:10 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LeBAH-000088-Oa for java-user@lucene.apache.org; Mon, 02 Mar 2009 08:38:49 -0800 Message-ID: <22291550.post@talk.nabble.com> Date: Mon, 2 Mar 2009 08:38:49 -0800 (PST) From: Chetan Shah To: java-user@lucene.apache.org Subject: RE: Sort Collection of ScoreDocs In-Reply-To: <70EBB17DC2A54DF5AC43917E58840864@VEGA> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: chetankrshah@gmail.com References: <22290563.post@talk.nabble.com> <70EBB17DC2A54DF5AC43917E58840864@VEGA> X-Virus-Checked: Checked by ClamAV on apache.org Perfect Thanks. Was also looking at org.apache.lucene.search.ScoreDocComparator Uwe Schindler wrote: > > How about java.util.Arrays.sort() on the array using a simple > Comparator with a compare() that returns -Float.compare(a.score, > b.score)? This is just about 7 lines of Java code. > > ----- > Uwe Schindler > H.-H.-Meier-Allee 63, D-28213 Bremen > http://www.thetaphi.de > eMail: uwe@thetaphi.de > >> -----Original Message----- >> From: Chetan Shah [mailto:chetankrshah@gmail.com] >> Sent: Monday, March 02, 2009 4:47 PM >> To: java-user@lucene.apache.org >> Subject: Sort Collection of ScoreDocs >> >> >> Is there an existing Utility class which will sort a collection of >> ScoreDocs >> ? I have a result set (array of ScoreDocs) stored in JVM and want to sort >> them by relevanceScore. I do not want to execute the query again. The >> stored >> result set is sorted by another term and hence the need. >> >> Would highly appreciate if you would please let me know how do I do so? >> >> Thanks, >> >> -Chetan >> -- >> View this message in context: http://www.nabble.com/Sort-Collection-of- >> ScoreDocs-tp22290563p22290563.html >> Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > > > -- View this message in context: http://www.nabble.com/Sort-Collection-of-ScoreDocs-tp22290563p22291550.html Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org