From lucene-user-return-2667-qmlist-jakarta-archive-lucene-user=jakarta.apache.org@jakarta.apache.org Tue Oct 15 12:32:03 2002 Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 40084 invoked from network); 15 Oct 2002 12:32:03 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 15 Oct 2002 12:32:03 -0000 Received: (qmail 8114 invoked by uid 97); 15 Oct 2002 12:32:47 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 8071 invoked by uid 97); 15 Oct 2002 12:32:46 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 8059 invoked by uid 98); 15 Oct 2002 12:32:45 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Reply-To: From: "Alex Murzaku" To: "'Lucene Users List'" Subject: RE: Are score values always between 0 and 1? Date: Tue, 15 Oct 2002 08:31:54 -0400 Organization: LISSUS llc Message-ID: <004801c27446$d9b696f0$0801000a@Lissus> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4024 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal In-Reply-To: <3DABCEC4.7070300@earthlink.net> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N As results are sorted by score, you just need to look at the first to set the score normalizer. The following code is from Hits.java: float scoreNorm = 1.0f; if (length > 0 && scoreDocs[0].score > 1.0f) scoreNorm = 1.0f / scoreDocs[0].score; int end = scoreDocs.length < length ? scoreDocs.length : length; for (int i = hitDocs.size(); i < end; i++) hitDocs.addElement(new HitDoc(scoreDocs[i].score*scoreNorm, scoreDocs[i].doc)); scoreNorm guarantees that all scores will be between 0 and 1. -----Original Message----- From: Dmitry Serebrennikov [mailto:dmitrys@earthlink.net] Sent: Tuesday, October 15, 2002 4:16 AM To: Lucene Users List Subject: Re: Are score values always between 0 and 1? Ype Kingma wrote: >On Tuesday 15 October 2002 04:16, Dmitry Serebrennikov wrote: > > >>Greetings, >> >>I know that the FAQ says that they are, but in at least one instance >>in my index it appears to be equal to 1.94something. Are the scores >>guaranteed to be between 0 and 1, and if not, what would it take to >>make them such? >> >> > >Division by the highest score perhaps? >I did this for a short while, but then I removed it again because >information >is lost by the division. However, it is mainly a matter of presentation to >users, so you could let them be you guide in this. > >Regards, >Ype > > > > Well, the problem is that I don't known what the highest score might be until I run into one that is higher than the one I thought was the highest until then... I'm trying to use this for making result from searcher always come before another in a MultiSearcher, but I need to know the upper bound on the scores to get this to work. -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: