Skip to content

Instantly share code, notes, and snippets.

@SQiShER
Created July 28, 2011 11:41
Show Gist options
  • Save SQiShER/1111424 to your computer and use it in GitHub Desktop.
Save SQiShER/1111424 to your computer and use it in GitHub Desktop.
This is the reason why Lucene scoring was a little bit off for searches with very short terms (if I recall correctly)
private final Similarity similarity = new DefaultSimilarity()
{
private static final long serialVersionUID = 1L;
@Override
public byte encodeNormValue(final float f)
{
return SmallFloat.floatToByte52(f);
}
@Override
public float decodeNormValue(final byte b)
{
return SmallFloat.byte52ToFloat(b);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment