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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-2 / +2 lines)
Lines 1061-1068 sub _fix_limit_special_cases { Link Here
1061
            next unless defined($start) && defined($end);
1061
            next unless defined($start) && defined($end);
1062
            push @new_lim, "date-of-publication:[$start TO $end]";
1062
            push @new_lim, "date-of-publication:[$start TO $end]";
1063
        }
1063
        }
1064
        elsif ( $l =~ /^yr,st-numeric=/ ) {
1064
        elsif ( $l =~ /^yr,st-numeric[=:]/ ) {
1065
            my ($date) = ( $l =~ /^yr,st-numeric=(.*)$/ );
1065
            my ($date) = ( $l =~ /^yr,st-numeric[=:](.*)$/ );
1066
            next unless defined($date);
1066
            next unless defined($date);
1067
            $date = $self->_modify_string_by_type(type => 'st-year', operand => $date);
1067
            $date = $self->_modify_string_by_type(type => 'st-year', operand => $date);
1068
            push @new_lim, "date-of-publication:$date";
1068
            push @new_lim, "date-of-publication:$date";
(-)a/t/db_dependent/Koha/SearchEngine/Elasticsearch/QueryBuilder.t (-2 / +9 lines)
Lines 215-221 subtest 'build_authorities_query_compat() tests' => sub { Link Here
215
};
215
};
216
216
217
subtest 'build_query tests' => sub {
217
subtest 'build_query tests' => sub {
218
    plan tests => 57;
218
    plan tests => 58;
219
219
220
    my $qb;
220
    my $qb;
221
221
Lines 339-344 subtest 'build_query tests' => sub { Link Here
339
        'Open end year in year range of an st-year search is handled properly'
339
        'Open end year in year range of an st-year search is handled properly'
340
    );
340
    );
341
341
342
    ( undef, $query ) = $qb->build_query_compat( undef, ['2019-'], ['yr,st-year'],
343
        ['yr,st-numeric:-2019','yr,st-numeric:2005','yr,st-numeric:1984-2022'] );
344
    is(
345
        $query->{query}{query_string}{query},
346
        '(date-of-publication:[2019 TO *]) AND (date-of-publication:[* TO 2019]) AND (date-of-publication:2005) AND (date-of-publication:[1984 TO 2022])',
347
        'Limit on year search is handled properly when colon used'
348
    );
349
342
    # Enable auto-truncation
350
    # Enable auto-truncation
343
    t::lib::Mocks::mock_preference( 'QueryAutoTruncate', '1' );
351
    t::lib::Mocks::mock_preference( 'QueryAutoTruncate', '1' );
344
352
345
- 

Return to bug 31076