Stephan, On Monday 21 March 2005 22:35, Stefan Groschupf wrote: > Hi there, > how to get the real boost value of a field or document? > The java doc says that it is _may_ not correct returned when reading a > document with a index reader. > Any hints how to get the boost when reading a document?
The javadoc of Field.setBoost() has meanwhile been extended a bit (source from the trunk at http://svn.apache.org/repos/asf/lucene/java/trunk/src/java/org/apache/lucene/document/): * <p>The boost is multiplied by [EMAIL PROTECTED] Document#getBoost()} of the document * containing this field. If a document has multiple fields with the same * name, all such values are multiplied together. This product is then * multipled by the value [EMAIL PROTECTED] Similarity#lengthNorm(String,int)}, and * rounded by [EMAIL PROTECTED] Similarity#encodeNorm(float)} before it is stored in the * index. One should attempt to ensure that this product does not overflow * the range of that encoding. One feature of Similarity.encodeNorm(float) is that it returns a byte, so at most 256 different values can be stored, which is a lot less than the number of possible floating point values. encodeNorm() rounds to a representable value close to the given float, and decodeNorm() returns that representable value, normally used in TermScorer. Regards, Paul Elschot --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]