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

(-)a/C4/Heading.pm (-7 / +34 lines)
Lines 194-199 sub _search { Link Here
194
    my $self         = shift;
194
    my $self         = shift;
195
    my $index        = shift || undef;
195
    my $index        = shift || undef;
196
    my $skipmetadata = shift || undef;
196
    my $skipmetadata = shift || undef;
197
    my $ind2         = $self->{field}->{_ind2};
198
    my $subject_heading_thesaurus = '';
197
    my @marclist;
199
    my @marclist;
198
    my @and_or;
200
    my @and_or;
199
    my @excluding = [];
201
    my @excluding = [];
Lines 207-219 sub _search { Link Here
207
        push @value,    $self->{'search_form'};
209
        push @value,    $self->{'search_form'};
208
    }
210
    }
209
211
210
    #    if ($self->{'thesaurus'}) {
212
    if ($self->{'thesaurus'}) {
211
    #        push @marclist, 'thesaurus';
213
        if ($ind2 eq '0') {
212
    #        push @and_or, 'AND';
214
           $subject_heading_thesaurus = 'a';
213
    #        push @excluding, '';
215
	    } elsif ($ind2 eq '1') {
214
    #        push @operator, 'is';
216
            $subject_heading_thesaurus = 'b';
215
    #        push @value, $self->{'thesaurus'};
217
        } elsif ($ind2 eq '2') {
216
    #    }
218
            $subject_heading_thesaurus = 'c';
219
        } elsif ($ind2 eq '3') {
220
            $subject_heading_thesaurus = 'd';
221
        } elsif ($ind2 eq '4') {
222
            $subject_heading_thesaurus = 'n';
223
        } elsif ($ind2 eq '5') {
224
            $subject_heading_thesaurus = 'k';
225
        } elsif ($ind2 eq '6') {
226
            $subject_heading_thesaurus = 'v';
227
        } else {
228
            $subject_heading_thesaurus = 'z';
229
        }
230
        push @marclist, 'thesaurus';
231
        push @and_or, 'and';
232
        push @excluding, '';
233
        push @operator, 'is';
234
        push @value, $subject_heading_thesaurus;
235
    }
236
237
    if ($ind2 eq '7') {
238
        push @marclist, 'thesaurus-conventions';
239
        push @and_or, 'and';
240
        push @excluding, '';
241
        push @operator, 'is';
242
        push @value, $self->{'thesaurus'};
243
    }
217
244
218
    require Koha::SearchEngine::QueryBuilder;
245
    require Koha::SearchEngine::QueryBuilder;
219
    require Koha::SearchEngine::Search;
246
    require Koha::SearchEngine::Search;
(-)a/C4/Linker/Default.pm (-11 / +13 lines)
Lines 30-43 sub get_link { Link Here
30
    my $behavior    = shift || 'default';
30
    my $behavior    = shift || 'default';
31
    my $search_form = $heading->search_form();
31
    my $search_form = $heading->search_form();
32
    my $auth_type = $heading->auth_type();
32
    my $auth_type = $heading->auth_type();
33
    my $thesaurus   = $heading->{thesaurus} || 'notdefined';
33
    my $authid;
34
    my $authid;
34
    my $fuzzy = 0;
35
    my $fuzzy = 0;
35
    my $match_count;
36
    my $match_count;
36
37
37
    if ( $self->{'cache'}->{$search_form.$auth_type}->{'cached'} ) {
38
    if ( $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'cached'} ) {
38
        $authid = $self->{'cache'}->{$search_form.$auth_type}->{'authid'};
39
        $authid = $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'authid'};
39
        $fuzzy  = $self->{'cache'}->{$search_form.$auth_type}->{'fuzzy'};
40
        $fuzzy  = $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'fuzzy'};
40
        $match_count = $self->{'cache'}->{$search_form.$auth_type}->{'match_count'};
41
        $match_count = $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'match_count'};
41
    }
42
    }
42
    else {
43
    else {
43
44
Lines 75-84 sub get_link { Link Here
75
            }
76
            }
76
        }
77
        }
77
78
78
        $self->{'cache'}->{$search_form.$auth_type}->{'cached'} = 1;
79
        $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'cached'} = 1;
79
        $self->{'cache'}->{$search_form.$auth_type}->{'authid'} = $authid;
80
        $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'authid'} = $authid;
80
        $self->{'cache'}->{$search_form.$auth_type}->{'fuzzy'}  = $fuzzy;
81
        $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'fuzzy'}  = $fuzzy;
81
        $self->{'cache'}->{$search_form.$auth_type}->{'match_count'} = $match_count;
82
        $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'match_count'} = $match_count;
82
    }
83
    }
83
    return $self->SUPER::_handle_auth_limit($authid), $fuzzy, $match_count;
84
    return $self->SUPER::_handle_auth_limit($authid), $fuzzy, $match_count;
84
}
85
}
Lines 89-99 sub update_cache { Link Here
89
    my $authid      = shift;
90
    my $authid      = shift;
90
    my $search_form = $heading->search_form();
91
    my $search_form = $heading->search_form();
91
    my $auth_type = $heading->auth_type();
92
    my $auth_type = $heading->auth_type();
93
    my $thesaurus   = $heading->{thesaurus} || 'notdefined';
92
    my $fuzzy = 0;
94
    my $fuzzy = 0;
93
95
94
    $self->{'cache'}->{$search_form.$auth_type}->{'cached'} = 1;
96
    $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'cached'} = 1;
95
    $self->{'cache'}->{$search_form.$auth_type}->{'authid'} = $authid;
97
    $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'authid'} = $authid;
96
    $self->{'cache'}->{$search_form.$auth_type}->{'fuzzy'}  = $fuzzy;
98
    $self->{'cache'}->{$search_form.$auth_type.$thesaurus}->{'fuzzy'}  = $fuzzy;
97
}
99
}
98
100
99
sub flip_heading {
101
sub flip_heading {
(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-1 / +1 lines)
Lines 559-564 our $koha_to_index_name = { Link Here
559
    'match-heading' => 'match-heading',
559
    'match-heading' => 'match-heading',
560
    'see-from'      => 'match-heading-see-from',
560
    'see-from'      => 'match-heading-see-from',
561
    thesaurus       => 'subject-heading-thesaurus',
561
    thesaurus       => 'subject-heading-thesaurus',
562
    'thesaurus-conventions' => 'subject-heading-thesaurus-conventions',
562
    any             => '',
563
    any             => '',
563
    all             => ''
564
    all             => ''
564
};
565
};
565
- 

Return to bug 30280