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

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