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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (+17 lines)
Lines 1098-1103 sub _fix_limit_special_cases { Link Here
1098
    my ( $self, $limits ) = @_;
1098
    my ( $self, $limits ) = @_;
1099
1099
1100
    my @new_lim;
1100
    my @new_lim;
1101
    my $ranges;
1101
    foreach my $l (@$limits) {
1102
    foreach my $l (@$limits) {
1102
        # This is set up by opac-search.pl
1103
        # This is set up by opac-search.pl
1103
        if ( $l =~ /^yr,st-numeric,ge[=:]/ ) {
1104
        if ( $l =~ /^yr,st-numeric,ge[=:]/ ) {
Lines 1165-1170 sub _fix_limit_special_cases { Link Here
1165
                push @new_lim, $term;
1166
                push @new_lim, $term;
1166
            }
1167
            }
1167
        }
1168
        }
1169
        elsif ($l =~ /^acqdate,(ge|le),st-date-normalized=/ ) {
1170
            my ($fromdate) = ( $l =~ /^acqdate,ge,st-date-normalized=(.*)$/ );
1171
            my ($todate) = ( $l =~ /^acqdate,le,st-date-normalized=(.*)$/ );
1172
            $fromdate ||= '*';
1173
            $todate ||= '*';
1174
            $ranges->{'date-of-acquisition.raw'} = {
1175
                from => $fromdate,
1176
                to => $todate
1177
            }
1178
        }
1168
        else {
1179
        else {
1169
            my ( $field, $term ) = $l =~ /^\s*([\w,-]*?):(.*)/;
1180
            my ( $field, $term ) = $l =~ /^\s*([\w,-]*?):(.*)/;
1170
            $field =~ s/,phr$//; #We are quoting all the limits as phrase, this prevents from quoting again later
1181
            $field =~ s/,phr$//; #We are quoting all the limits as phrase, this prevents from quoting again later
Lines 1175-1180 sub _fix_limit_special_cases { Link Here
1175
                push @new_lim, $l;
1186
                push @new_lim, $l;
1176
            }
1187
            }
1177
        }
1188
        }
1189
1190
        if ( $ranges ) {
1191
            foreach my $index ( keys %$ranges ) {
1192
                push @new_lim, "$index:[$ranges->{$index}{from} TO $ranges->{$index}{to}]"
1193
            }
1194
        }
1178
    }
1195
    }
1179
    return \@new_lim;
1196
    return \@new_lim;
1180
}
1197
}
(-)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