Honor the 'active' flag in QueryParser.pm for search.relevance_adjustment entries.
authordbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 22 Mar 2011 14:39:56 +0000 (14:39 +0000)
committerdbwells <dbwells@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 22 Mar 2011 14:39:56 +0000 (14:39 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19849 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm

index a930931..c74ffee 100644 (file)
@@ -208,7 +208,11 @@ sub add_relevance_bump {
     my $multiplier = shift;
     my $active = shift;
 
     my $multiplier = shift;
     my $active = shift;
 
-    $active = 1 if (!defined($active));
+    if (defined($active) and $active eq 'f') {
+        $active = 0;
+    } else {
+        $active = 1;
+    }
 
     $self->relevance_bumps->{$class}{$field}{$type} = { multiplier => $multiplier, active => $active };
 
 
     $self->relevance_bumps->{$class}{$field}{$type} = { multiplier => $multiplier, active => $active };
 
@@ -248,7 +252,7 @@ sub initialize_relevance_bumps {
 
     for my $sra (@$sra_list) {
         my $c = $self->search_field_class_by_id( $sra->field );
 
     for my $sra (@$sra_list) {
         my $c = $self->search_field_class_by_id( $sra->field );
-        __PACKAGE__->add_relevance_bump( $c->{classname}, $c->{field}, $sra->bump_type, $sra->multiplier );
+        __PACKAGE__->add_relevance_bump( $c->{classname}, $c->{field}, $sra->bump_type, $sra->multiplier, $sra->active );
     }
 
     return $self->relevance_bumps;
     }
 
     return $self->relevance_bumps;