@@ -, +, @@ --- C4/AuthoritiesMarc.pm | 105 ++++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 51 deletions(-) --- a/C4/AuthoritiesMarc.pm +++ a/C4/AuthoritiesMarc.pm @@ -143,57 +143,60 @@ sub SearchAuthorities { for(my $i = 0 ; $i <= $#{$value} ; $i++) { if (@$value[$i]){ - if ( @$tags[$i] eq "mainmainentry" ) { - $attr = " \@attr 1=Heading-Main "; - } - elsif ( @$tags[$i] eq "mainentry" ) { - $attr = " \@attr 1=Heading "; - } - elsif ( @$tags[$i] eq "match" ) { - $attr = " \@attr 1=Match "; - } - elsif ( @$tags[$i] eq "match-heading" ) { - $attr = " \@attr 1=Match-heading "; - } - elsif ( @$tags[$i] eq "see-from" ) { - $attr = " \@attr 1=Match-heading-see-from "; - } - elsif ( @$tags[$i] eq "thesaurus" ) { - $attr = " \@attr 1=Subject-heading-thesaurus "; - } - else { # Assume any if no index was specified - $attr = " \@attr 1=Any "; - } - if ( @$operator[$i] eq 'is' ) { - $attr .= " \@attr 4=1 \@attr 5=100 " - ; ##Phrase, No truncation,all of subfield field must match - } - elsif ( @$operator[$i] eq "=" ) { - $attr .= " \@attr 4=107 "; #Number Exact match - } - elsif ( @$operator[$i] eq "start" ) { - $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 " - ; #Firstinfield Phrase, Right truncated - } - elsif ( @$operator[$i] eq "exact" ) { - $attr .= " \@attr 4=1 \@attr 5=100 \@attr 6=3 " - ; ##Phrase, No truncation,all of subfield field must match - } - else { - $attr .= " \@attr 5=1 \@attr 4=6 " - ; ## Word list, right truncated, anywhere - if ($sortby eq 'Relevance') { - $attr .= "\@attr 2=102 "; - } - } - @$value[$i] =~ s/"/\\"/g; # Escape the double-quotes in the search value - $attr =$attr."\"".@$value[$i]."\""; - $q2 .=$attr; - $dosearch=1; - ++$attr_cnt; - if ($QParser) { - $qpquery .= " $tags->[$i]:\"$value->[$i]\""; - } + if ( @$tags[$i] ) { + if ( @$tags[$i] eq "mainmainentry" ) { + $attr = " \@attr 1=Heading-Main "; + } + elsif ( @$tags[$i] eq "mainentry" ) { + $attr = " \@attr 1=Heading "; + } + elsif ( @$tags[$i] eq "match" ) { + $attr = " \@attr 1=Match "; + } + elsif ( @$tags[$i] eq "match-heading" ) { + $attr = " \@attr 1=Match-heading "; + } + elsif ( @$tags[$i] eq "see-from" ) { + $attr = " \@attr 1=Match-heading-see-from "; + } + elsif ( @$tags[$i] eq "thesaurus" ) { + $attr = " \@attr 1=Subject-heading-thesaurus "; + } + else { # Assume any if no index was specified + $attr = " \@attr 1=Any "; + } + if ( @$operator[$i] eq 'is' ) { + $attr .= " \@attr 4=1 \@attr 5=100 " + ; ##Phrase, No truncation,all of subfield field must match + } + elsif ( @$operator[$i] eq "=" ) { + $attr .= " \@attr 4=107 "; #Number Exact match + } + elsif ( @$operator[$i] eq "start" ) { + $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 " + ; #Firstinfield Phrase, Right truncated + } + elsif ( @$operator[$i] eq "exact" ) { + $attr .= " \@attr 4=1 \@attr 5=100 \@attr 6=3 " + ; ##Phrase, No truncation,all of subfield field must match + } + else { + $attr .= " \@attr 5=1 \@attr 4=6 " + ; ## Word list, right truncated, anywhere + if ( $sortby eq 'Relevance' ) { + $attr .= "\@attr 2=102 "; + } + } + @$value[$i] =~ + s/"/\\"/g; # Escape the double-quotes in the search value + $attr = $attr . "\"" . @$value[$i] . "\""; + $q2 .= $attr; + $dosearch = 1; + ++$attr_cnt; + if ($QParser) { + $qpquery .= " $tags->[$i]:\"$value->[$i]\""; + } + } #if (@$tags[$i) }#if value } ##Add how many queries generated --