pushed ranking to all currently used methods
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 28 Feb 2006 21:42:54 +0000 (21:42 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 28 Feb 2006 21:42:54 +0000 (21:42 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3222 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm

index 3c6dd18..3e00baf 100644 (file)
@@ -1207,10 +1207,15 @@ sub postfilter_search_class_fts {
        
        $log->debug("Search yielded ".scalar(@$recs)." results.",DEBUG);
 
+       my $max = 0;
+       for (@$recs) {
+               $max = $$_[3] if ($$_[3] > $max);
+       }
+
        my $count = scalar(@$recs);
        for my $rec (@$recs[$offset .. $offset + $limit - 1]) {
                my ($mrid,$rank,$skip) = @$rec;
-               $client->respond( [$mrid, sprintf('%0.3f',$rank), $skip, $count] );
+               $client->respond( [$mrid, sprintf('%0.3f',$rank/$max), $skip, $count] );
        }
        return undef;
 }
@@ -1489,7 +1494,7 @@ sub postfilter_search_multi_class_fts {
 
        my $max = 0;
        for (@$recs) {
-               $max = $$_[2] if ($$_[2] > $max);
+               $max = $$_[3] if ($$_[3] > $max);
        }
 
        my $count = scalar(@$recs);