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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-3 / +5 lines)
Lines 999-1004 The argument should be an arrayref, and it'll return an arrayref. Link Here
999
sub _fix_limit_special_cases {
999
sub _fix_limit_special_cases {
1000
    my ( $self, $limits ) = @_;
1000
    my ( $self, $limits ) = @_;
1001
1001
1002
    # yr is usually an alias of a search field
1003
    my $yrfield = ( exists $index_field_convert{'yr'} ) ? $index_field_convert{'yr'} : 'yr';
1004
1002
    my @new_lim;
1005
    my @new_lim;
1003
    foreach my $l (@$limits) {
1006
    foreach my $l (@$limits) {
1004
1007
Lines 1007-1019 sub _fix_limit_special_cases { Link Here
1007
            my ( $start, $end ) =
1010
            my ( $start, $end ) =
1008
              ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ );
1011
              ( $l =~ /^yr,st-numeric,ge=(.*) and yr,st-numeric,le=(.*)$/ );
1009
            next unless defined($start) && defined($end);
1012
            next unless defined($start) && defined($end);
1010
            push @new_lim, "copydate:[$start TO $end]";
1013
            push @new_lim, "$yrfield:[$start TO $end]";
1011
        }
1014
        }
1012
        elsif ( $l =~ /^yr,st-numeric=/ ) {
1015
        elsif ( $l =~ /^yr,st-numeric=/ ) {
1013
            my ($date) = ( $l =~ /^yr,st-numeric=(.*)$/ );
1016
            my ($date) = ( $l =~ /^yr,st-numeric=(.*)$/ );
1014
            next unless defined($date);
1017
            next unless defined($date);
1015
            $date = $self->_modify_string_by_type(type => 'st-year', operand => $date);
1018
            $date = $self->_modify_string_by_type(type => 'st-year', operand => $date);
1016
            push @new_lim, "copydate:$date";
1019
            push @new_lim, "$yrfield:$date";
1017
        }
1020
        }
1018
        elsif ( $l =~ /^available$/ ) {
1021
        elsif ( $l =~ /^available$/ ) {
1019
            push @new_lim, 'onloan:false';
1022
            push @new_lim, 'onloan:false';
1020
- 

Return to bug 22801