Changeset 668

Show
Ignore:
Timestamp:
03/02/05 18:21:38 (4 years ago)
Author:
torben
Message:

Fixed score scaling.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/external-tools/indexer-backends/plucene/Midcom/Plucene/QueryRequest.pm

    r437 r668  
    138138                (0..($hits->length-1)); 
    139139         
     140        my $best_score = 0; 
     141        if ($hits->length > 0) 
     142        { 
     143                $best_score = $hits->score($order[0]); 
     144        } 
     145         
    140146        foreach my $i (@order) 
    141147        { 
     
    143149                my $score = $hits->score($i); 
    144150                my $id = $doc->get('__RI')->string; 
     151 
     152                if ($best_score > 1) 
     153                { 
     154                        $score /= $best_score; 
     155                } 
    145156 
    146157                $output->startTag('document',