View | Details | Raw Unified | Return to bug 12861
Collapse All | Expand All

(-)a/C4/AuthoritiesMarc.pm (-52 / +54 lines)
Lines 143-199 sub SearchAuthorities { Link Here
143
    for(my $i = 0 ; $i <= $#{$value} ; $i++)
143
    for(my $i = 0 ; $i <= $#{$value} ; $i++)
144
    {
144
    {
145
        if (@$value[$i]){
145
        if (@$value[$i]){
146
            if ( @$tags[$i] eq "mainmainentry" ) {
146
            if ( @$tags[$i] ) {
147
                $attr = " \@attr 1=Heading-Main ";
147
                if ( @$tags[$i] eq "mainmainentry" ) {
148
            }
148
                    $attr = " \@attr 1=Heading-Main ";
149
            elsif ( @$tags[$i] eq "mainentry" ) {
149
                }
150
                $attr = " \@attr 1=Heading ";
150
                elsif ( @$tags[$i] eq "mainentry" ) {
151
            }
151
                    $attr = " \@attr 1=Heading ";
152
            elsif ( @$tags[$i] eq "match" ) {
152
                }
153
                $attr = " \@attr 1=Match ";
153
                elsif ( @$tags[$i] eq "match" ) {
154
            }
154
                    $attr = " \@attr 1=Match ";
155
            elsif ( @$tags[$i] eq "match-heading" ) {
155
                }
156
                $attr = " \@attr 1=Match-heading ";
156
                elsif ( @$tags[$i] eq "match-heading" ) {
157
            }
157
                    $attr = " \@attr 1=Match-heading ";
158
            elsif ( @$tags[$i] eq "see-from" ) {
158
                }
159
                $attr = " \@attr 1=Match-heading-see-from ";
159
                elsif ( @$tags[$i] eq "see-from" ) {
160
            }
160
                    $attr = " \@attr 1=Match-heading-see-from ";
161
            elsif ( @$tags[$i] eq "thesaurus" ) {
161
                }
162
                $attr = " \@attr 1=Subject-heading-thesaurus ";
162
                elsif ( @$tags[$i] eq "thesaurus" ) {
163
            }
163
                    $attr = " \@attr 1=Subject-heading-thesaurus ";
164
            else { # Assume any if no index was specified
164
                }
165
                $attr = " \@attr 1=Any ";
165
                else {    # Assume any if no index was specified
166
            }
166
                    $attr = " \@attr 1=Any ";
167
            if ( @$operator[$i] eq 'is' ) {
167
                }
168
                $attr .= " \@attr 4=1  \@attr 5=100 "
168
                if ( @$operator[$i] eq 'is' ) {
169
                  ; ##Phrase, No truncation,all of subfield field must match
169
                    $attr .= " \@attr 4=1  \@attr 5=100 "
170
            }
170
                      ; ##Phrase, No truncation,all of subfield field must match
171
            elsif ( @$operator[$i] eq "=" ) {
171
                }
172
                $attr .= " \@attr 4=107 ";    #Number Exact match
172
                elsif ( @$operator[$i] eq "=" ) {
173
            }
173
                    $attr .= " \@attr 4=107 ";    #Number Exact match
174
            elsif ( @$operator[$i] eq "start" ) {
174
                }
175
                $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 "
175
                elsif ( @$operator[$i] eq "start" ) {
176
                  ;    #Firstinfield Phrase, Right truncated
176
                    $attr .= " \@attr 3=2 \@attr 4=1 \@attr 5=1 "
177
            }
177
                      ;    #Firstinfield Phrase, Right truncated
178
            elsif ( @$operator[$i] eq "exact" ) {
178
                }
179
                $attr .= " \@attr 4=1  \@attr 5=100 \@attr 6=3 "
179
                elsif ( @$operator[$i] eq "exact" ) {
180
                  ; ##Phrase, No truncation,all of subfield field must match
180
                    $attr .= " \@attr 4=1  \@attr 5=100 \@attr 6=3 "
181
            }
181
                      ; ##Phrase, No truncation,all of subfield field must match
182
            else {
182
                }
183
                $attr .= " \@attr 5=1 \@attr 4=6 "
183
                else {
184
                  ;    ## Word list, right truncated, anywhere
184
                    $attr .= " \@attr 5=1 \@attr 4=6 "
185
                  if ($sortby eq 'Relevance') {
185
                      ;    ## Word list, right truncated, anywhere
186
                      $attr .= "\@attr 2=102 ";
186
                    if ( $sortby eq 'Relevance' ) {
187
                  }
187
                        $attr .= "\@attr 2=102 ";
188
            }
188
                    }
189
            @$value[$i] =~ s/"/\\"/g; # Escape the double-quotes in the search value
189
                }
190
            $attr =$attr."\"".@$value[$i]."\"";
190
                @$value[$i] =~
191
            $q2 .=$attr;
191
                  s/"/\\"/g;    # Escape the double-quotes in the search value
192
            $dosearch=1;
192
                $attr = $attr . "\"" . @$value[$i] . "\"";
193
            ++$attr_cnt;
193
                $q2 .= $attr;
194
            if ($QParser) {
194
                $dosearch = 1;
195
                $qpquery .= " $tags->[$i]:\"$value->[$i]\"";
195
                ++$attr_cnt;
196
            }
196
                if ($QParser) {
197
                    $qpquery .= " $tags->[$i]:\"$value->[$i]\"";
198
                }
199
            } #if (@$tags[$i)
197
        }#if value
200
        }#if value
198
    }
201
    }
199
    ##Add how many queries generated
202
    ##Add how many queries generated
200
- 

Return to bug 12861