1 Sep 2003 17:04
Issue with Similarity and negative numbers
Nick Smith <nick.smith <at> techop.ch>
2003-09-01 15:04:55 GMT
2003-09-01 15:04:55 GMT
Hi Luceners! I am misusing the document score for date sorting (I display news headlines in a chronological list). As the document score is ultimately encoded as a byte the maximum possible number of values is 256 minus the special value of 0 (document not found). In the current implementation; all negative float values get rounded up to zero by Similarity.floatToByte() and the method Similarity.byteToFloat() returns only values in the range of 1 to 127 values that are greater than the decode for the next lower byte value. i.e. Similarity.byteToFloat(byteVal+1) > Similarity.byteToFloat(byteVal) For my application having 255 possible scores from searches was better than 127 so.... I have patched the Similarity class to encode negative floats into the negative byte values and to decode the negative byte values back into negative floats. The encoding of the positive values are unchanged by this patch. Could this version please be checked into CVS by someone with commit rights? Or is there are a more formal procedure to submitting patches, say via the Bugzilla?(Continue reading)
RSS Feed