From a67bce36b0c1eb79bb7fcd45ec6a7ec8e873522c Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 2 Jun 2014 11:14:11 -0300 Subject: [PATCH] Bug 12151: Remove uses of smartmatch operator from Koha/Solr/QueryBuilder.pm Just that. Regards To+ Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer Passes QA script and tests. Could only verify by reading the code. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Galen Charlton --- Koha/SearchEngine/Solr/QueryBuilder.pm | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Koha/SearchEngine/Solr/QueryBuilder.pm b/Koha/SearchEngine/Solr/QueryBuilder.pm index b3e75c98cd..ba5547f682 100644 --- a/Koha/SearchEngine/Solr/QueryBuilder.pm +++ b/Koha/SearchEngine/Solr/QueryBuilder.pm @@ -60,16 +60,12 @@ sub build_advanced_query { # And others $index_name = @$indexes[$i] if @$indexes[$i]; my $operator = defined @$operators[$i-1] ? @$operators[$i-1] : 'AND'; - for ( uc ( $operator ) ) { - when ('OR'){ - $q .= BuildTokenString($index_name, $kw, 'OR'); - } - when ('NOT'){ - $q .= BuildTokenString($index_name, $kw, 'NOT'); - } - default { - $q .= BuildTokenString($index_name, $kw, 'AND'); - } + if ( uc ( $operator ) eq 'OR' ) { + $q .= BuildTokenString($index_name, $kw, 'OR'); + } elsif ( uc ( $operator ) eq 'NOT' ) { + $q .= BuildTokenString($index_name, $kw, 'NOT'); + } else { + $q .= BuildTokenString($index_name, $kw, 'AND'); } $i = $i + 1; } -- 2.39.5