lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: problem with field.setboost(5.0f) on lucene 2.00
Date Fri, 02 Feb 2007 06:44:20 GMT

: it still dont make any change on the boost value, for information i use
: luke.jar to see if the value had change

i'm not sure what you mean you're using luke to see if hte value has
changed ... boosts aren't stored in the index (they are used to compute a
fieldNorm) so there's nothing for luke to show you (but i haven't played
with luke extensively so i'm not sure what you might be looking at that
relates to boosts)

please note the javadocs for setBoost and getBoost...

public void setBoost(float boost)

    Sets the boost factor hits on this field. This value will be
multiplied into the score of all hits on this this field of this document.

    The boost is multiplied by 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 Similarity.lengthNorm(String,int), and rounded by
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

public float getBoost()

    Returns the boost factor for hits for this field.

    The default value is 1.0.

    Note: this value is not stored directly with the document in the
index. Documents returned from IndexReader.document(int) and Hits.doc(int)
may thus not have the same value present as when this field was indexed.


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

View raw message