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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (+17 lines)
Lines 1087-1092 sub _fix_limit_special_cases { Link Here
1087
    my ( $self, $limits ) = @_;
1087
    my ( $self, $limits ) = @_;
1088
1088
1089
    my @new_lim;
1089
    my @new_lim;
1090
    my $ranges;
1090
    foreach my $l (@$limits) {
1091
    foreach my $l (@$limits) {
1091
        # This is set up by opac-search.pl
1092
        # This is set up by opac-search.pl
1092
        if ( $l =~ /^yr,st-numeric,ge[=:]/ ) {
1093
        if ( $l =~ /^yr,st-numeric,ge[=:]/ ) {
Lines 1154-1159 sub _fix_limit_special_cases { Link Here
1154
                push @new_lim, $term;
1155
                push @new_lim, $term;
1155
            }
1156
            }
1156
        }
1157
        }
1158
        elsif ($l =~ /^acqdate,(ge|le),st-date-normalized=/ ) {
1159
            my ($fromdate) = ( $l =~ /^acqdate,ge,st-date-normalized=(.*)$/ );
1160
            my ($todate) = ( $l =~ /^acqdate,le,st-date-normalized=(.*)$/ );
1161
            $fromdate ||= '*';
1162
            $todate ||= '*';
1163
            $ranges->{'date-of-acquisition.raw'} = {
1164
                from => $fromdate,
1165
                to => $todate
1166
            }
1167
        }
1157
        else {
1168
        else {
1158
            my ( $field, $term ) = $l =~ /^\s*([\w,-]*?):(.*)/;
1169
            my ( $field, $term ) = $l =~ /^\s*([\w,-]*?):(.*)/;
1159
            $field =~ s/,phr$//; #We are quoting all the limits as phrase, this prevents from quoting again later
1170
            $field =~ s/,phr$//; #We are quoting all the limits as phrase, this prevents from quoting again later
Lines 1164-1169 sub _fix_limit_special_cases { Link Here
1164
                push @new_lim, $l;
1175
                push @new_lim, $l;
1165
            }
1176
            }
1166
        }
1177
        }
1178
1179
        if ( $ranges ) {
1180
            foreach my $index ( keys %$ranges ) {
1181
                push @new_lim, "$index:[$ranges->{$index}{from} TO $ranges->{$index}{to}]"
1182
            }
1183
        }
1167
    }
1184
    }
1168
    return \@new_lim;
1185
    return \@new_lim;
1169
}
1186
}
(-)a/labels/label-item-search.pl (-7 / +8 lines)
Lines 32-37 use C4::Creators::Lib qw( html_table ); Link Here
32
use Koha::Logger;
32
use Koha::Logger;
33
use Koha::Items;
33
use Koha::Items;
34
use Koha::ItemTypes;
34
use Koha::ItemTypes;
35
use Koha::SearchEngine::QueryBuilder;
35
use Koha::SearchEngine::Search;
36
use Koha::SearchEngine::Search;
36
37
37
my $query = CGI->new;
38
my $query = CGI->new;
Lines 76-95 if ( $op eq "do_search" ) { Link Here
76
        push(@limits, "acqdate,le,st-date-normalized=$dateto");
77
        push(@limits, "acqdate,le,st-date-normalized=$dateto");
77
    }
78
    }
78
79
79
    my ( $error, $query, $simple_query, $query_cgi,
80
    my ( $build_error, $query, $simple_query, $query_cgi,
80
        $query_desc, $limit, $limit_cgi, $limit_desc,
81
        $query_desc, $limit, $limit_cgi, $limit_desc,
81
        $query_type )
82
        $query_type )
82
        = $builder->build_query_compat( undef, [$ccl_textbox], [$idx], \@limits);
83
        = $builder->build_query_compat( undef, [$ccl_textbox], [$idx], \@limits);
83
84
84
    my $offset = $startfrom > 1 ? $startfrom - 1 : 0;
85
    my $offset = $startfrom > 1 ? $startfrom - 1 : 0;
85
86
86
    my ( $error, $marcresults, $facets ) = $searcher->search_compat(
87
    my ( $error, $results, $facets ) = $searcher->search_compat(
87
        $query, $simple_query, undef, ['biblioserver'], $resultsperpage, $offset,
88
        $query, $simple_query, [], ['biblioserver'], $resultsperpage, $offset,
88
        undef, undef, $query_type, undef
89
        undef, undef, $query_type, undef
89
   );
90
    );
90
91
91
    if (!defined $error && $marcresults->{biblioserver}{RECORDS} ) {
92
    if (!defined $error && @{$results->{biblioserver}{RECORDS}} ) {
92
        $show_results = $marcresults->{biblioserver}{RECORDS};
93
        $show_results = @{$results->{biblioserver}{RECORDS}};
94
        $marcresults = $results->{biblioserver}{RECORDS};
93
    }
95
    }
94
    else {
96
    else {
95
        Koha::Logger->get->warn("ERROR label-item-search: no results from simple_search_compat");
97
        Koha::Logger->get->warn("ERROR label-item-search: no results from simple_search_compat");
96
- 

Return to bug 30745