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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (+5 lines)
Lines 1150-1155 sub _fix_limit_special_cases { Link Here
1150
        elsif ( $l =~ /^available$/ ) {
1150
        elsif ( $l =~ /^available$/ ) {
1151
            push @new_lim, 'available:true';
1151
            push @new_lim, 'available:true';
1152
        }
1152
        }
1153
        elsif ( $l =~ /^component_records$/ ) {
1154
            push @new_lim, '(bib-level:a OR bib-level:b)';
1155
        } elsif ( $l =~ /^exclude_component_records$/ ) {
1156
            push @new_lim, 'NOT (bib-level:a OR bib-level:b)';
1157
        }
1153
        elsif ( $l =~ /^\s*(kw\b[\w,-]*?):(.*)/) {
1158
        elsif ( $l =~ /^\s*(kw\b[\w,-]*?):(.*)/) {
1154
            my ( $field, $term ) = ($1, $2);
1159
            my ( $field, $term ) = ($1, $2);
1155
            if ( defined($field) && defined($term) && $field =~ /,phr$/) {
1160
            if ( defined($field) && defined($term) && $field =~ /,phr$/) {
(-)a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t (-2 / +14 lines)
Lines 219-225 subtest 'build_authorities_query_compat() tests' => sub { Link Here
219
};
219
};
220
220
221
subtest 'build_query tests' => sub {
221
subtest 'build_query tests' => sub {
222
    plan tests => 58;
222
    plan tests => 60;
223
223
224
    my $qb;
224
    my $qb;
225
225
Lines 379-384 subtest 'build_query tests' => sub { Link Here
379
        "query with quotes is unaltered when QueryAutoTruncate is enabled"
379
        "query with quotes is unaltered when QueryAutoTruncate is enabled"
380
    );
380
    );
381
381
382
    ( undef, $query ) = $qb->build_query_compat( undef, ['"donald duck"'], undef, ['component_records'] );
383
    is(
384
        $query->{query}{query_string}{query},
385
        '("donald duck") AND (bib-level:a OR bib-level:b)',
386
        "Component records limit is handled properly"
387
    );
388
389
    ( undef, $query ) = $qb->build_query_compat( undef, ['"donald duck"'], undef, ['exclude_component_records'] );
390
    is(
391
        $query->{query}{query_string}{query},
392
        '("donald duck") AND NOT (bib-level:a OR bib-level:b)',
393
        "Host records limit is handled properly"
394
    );
382
395
383
    ( undef, $query ) = $qb->build_query_compat( undef, ['"donald duck" and "the mouse"'] );
396
    ( undef, $query ) = $qb->build_query_compat( undef, ['"donald duck" and "the mouse"'] );
384
    is(
397
    is(
385
- 

Return to bug 15728