lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Heilbrunn <>
Subject Change norm encoding
Date Mon, 09 Nov 2009 16:04:09 GMT

i've got a problem concerning encoding of norms.
I want to use int values (0-255) instead of float interpreted bytes.

In my own Similarity-Class, which I use for indexing and searching, I
implemented the static methods encodeNorms, decodeNorms and
But because they are static and the encoding of norms happens in
NormsWriterPerField.finish() with the following lines of code:

      final float norm =
docState.similarity.computeNorm(, fieldState);
      norms[upto] = Similarity.encodeNorm(norm);
      docIDs[upto] = docState.docID

my implementation is only used for computation of norm values but not
for the encoding.
Is there a reason why norm encoding and decoding is hardwired to the
implementation in Similarity?

And is there any elegant way to bypass this behaviour instead of
implementing an mapper, which maps every int between 0 and 255 to an
float value out of Similarity.NORM_TABLE, befor encoding.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message