lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bastian Grimm [Eastbeam GmbH]">
Subject problem with get/setBoost of document fields
Date Wed, 22 Sep 2004 16:44:31 GMT
hi all,

i have a strange problem with the get and setBoost functions 
(lucene-1.4.1). i am trying the following code:

Document d1 = new Document();
Field f1 = Field.Text("field", "word");

so if i'am right, this must be an overall boostfaktor of 6.0f for the 
if i try to get these boosts with:

Document doc = hits.doc(x);

1.0 is returned in both cases. i dont really know what's wrong. i also 
tried some other types of Field.XXX , but nothing changed.

Another strange beheaviour is that:

    final float[] scores = new float[1];
    new IndexSearcher(store).search
      (new TermQuery(new Term("field", "word")),
       new HitCollector() {
         public final void collect(int doc, float score) {
           scores[doc] = score;
       for (int i = 0; i < 1; i++) {

This function returns different scores if the boosts are changed but why 
aren't these boosts displayed correctly? any ideas?

if i set the d1 and f1 boost  to 1.0f (default) the score returned by 
the HitCollector is 0.3xxx - shouldn't it be exactly 1.0 ?

thanks for your time and kind regards from germany.

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

View raw message