You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2008/04/06 02:56:19 UTC

[Lucene-java Wiki] Update of "Payloads" by TriciaWilliams

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 */