lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Lucene-java Wiki] Update of "Payloads" by TriciaWilliams
Date Sun, 06 Apr 2008 00:56:19 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lucene-java Wiki" for change notification.

The following page has been changed by TriciaWilliams:
http://wiki.apache.org/lucene-java/Payloads

The comment on the change is:
tidbit from "tweak to analysis.jsp for payload" thread

------------------------------------------------------------------------------
  
  == Scoring Payloads ==
  
+ Similarity.scorePayload(), if defined, should be the commonly-used method.  This is what
Mike Klaas does: {{{
+ 
+   public float scorePayload(byte [] payload, int offset, int length) {
+     assert length == 4;
+     int accum = ((payload[0+offset]&0xff)) |
+                 ((payload[1+offset]&0xff)<<8) |
+                 ((payload[2+offset]&0xff)<<16)  |
+                 ((payload[3+offset]&0xff)<<24);
+ 
+     return Float.intBitsToFloat(accum);
+   }
+ 
+ }}} 
+ 
  /* TODO */
  

Mime
View raw message