Return-Path: Delivered-To: apmail-jakarta-lucene-dev-archive@apache.org Received: (qmail 73701 invoked from network); 24 Jan 2003 13:50:35 -0000 Received: from exchange.sun.com (192.18.33.10) by 208.185.179.12.available.above.net with SMTP; 24 Jan 2003 13:50:35 -0000 Received: (qmail 29492 invoked by uid 97); 24 Jan 2003 13:51:56 -0000 Delivered-To: qmlist-jakarta-archive-lucene-dev@jakarta.apache.org Received: (qmail 29431 invoked by uid 97); 24 Jan 2003 13:51:54 -0000 Mailing-List: contact lucene-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Developers List" Reply-To: "Lucene Developers List" Delivered-To: mailing list lucene-dev@jakarta.apache.org Received: (qmail 29418 invoked by uid 98); 24 Jan 2003 13:51:54 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: Fri, 24 Jan 2003 14:50:26 +0100 (MET) From: Nick Smith Subject: Similarity.encodeNorm() / decodeNorm() funny. To: lucene-dev@jakarta.apache.org Reply-to: Nick Smith Message-id: <0H9800H9U142VL@web.techop.ch> MIME-version: 1.0 X-Mailer: dtmail 1.3.0 @(#)CDE Version 1.4.6_06 SunOS 5.8 sun4u sparc Content-type: TEXT/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-MD5: 6cv8lIq2+fzCQAxjbbUKvw== X-Spam-Rating: 208.185.179.12.available.above.net 1.6.2 0/1000/N X-Spam-Rating: 208.185.179.12.available.above.net 1.6.2 0/1000/N Hi Luceners, I'm (mis)using the field normalisation factor for my own sorting purposes. I create a sorting indicator as a byte value and use Similarity.decodeNorm() to create the float value suitable and have encounter the following : I made the assumption that encodeNorm(decodeNorm(abyte)) == abyte i.e. it is reflexive function. However the assumption is value for values 1-7 (values -128 to 0 and 1 to 127 are as expected) - see below... in = 0 float = 0.0 out = 0 in = 1 float = 5.820766E-10 out = 8 in = 2 float = 6.9849193E-10 out = 8 in = 3 float = 8.1490725E-10 out = 8 in = 4 float = 9.313226E-10 out = 8 in = 5 float = 1.1641532E-9 out = 8 in = 6 float = 1.3969839E-9 out = 8 in = 7 float = 1.6298145E-9 out = 8 in = 8 float = 1.8626451E-9 out = 8 in = 9 float = 2.3283064E-9 out = 9 Now that I know of this "feature" I can workaround it but using only the range 9-127 (which is enough in my case). I've posted this because it has caused a mistifying problem in our product and others _might_ be encountering the same "feature". Many Thanks for the work people do on Lucene!!! Cheers, Nick -- To unsubscribe, e-mail: For additional commands, e-mail: