Lines 40-46
my $query = CGI->new;
Link Here
|
40 |
my $type = $query->param('type'); |
40 |
my $type = $query->param('type'); |
41 |
my $op = $query->param('op') || ''; |
41 |
my $op = $query->param('op') || ''; |
42 |
my $batch_id = $query->param('batch_id'); |
42 |
my $batch_id = $query->param('batch_id'); |
43 |
my @limits = split(" AND ", $query->param('limits') || ""); |
43 |
my @limits = split( " AND ", $query->param('limits') || "" ); |
44 |
my $startfrom = $query->param('startfrom') || 1; |
44 |
my $startfrom = $query->param('startfrom') || 1; |
45 |
my ($template, $loggedinuser, $cookie) = (undef, undef, undef); |
45 |
my ($template, $loggedinuser, $cookie) = (undef, undef, undef); |
46 |
my ( |
46 |
my ( |
Lines 63-95
if ( $op eq "do_search" ) {
Link Here
|
63 |
$datefrom = $query->param('datefrom'); |
63 |
$datefrom = $query->param('datefrom'); |
64 |
$dateto = $query->param('dateto'); |
64 |
$dateto = $query->param('dateto'); |
65 |
|
65 |
|
66 |
my $builder = Koha::SearchEngine::QueryBuilder->new( |
66 |
my $builder = Koha::SearchEngine::QueryBuilder->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
67 |
{ index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
67 |
my $searcher = Koha::SearchEngine::Search->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
68 |
my $searcher = Koha::SearchEngine::Search->new( |
|
|
69 |
{ index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
70 |
|
68 |
|
71 |
if (!@limits) { |
69 |
if ( !@limits ) { |
72 |
push(@limits, "acqdate,st-date-normalized=$datefrom - $dateto"); |
70 |
push( @limits, "acqdate,st-date-normalized=$datefrom - $dateto" ); |
73 |
} |
71 |
} |
74 |
|
72 |
|
75 |
my ( $build_error, $query, $simple_query, $query_cgi, |
73 |
my ( |
76 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
74 |
$build_error, $query, $simple_query, $query_cgi, |
77 |
$query_type ) |
75 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
78 |
= $builder->build_query_compat( undef, [$ccl_textbox], [$idx], \@limits); |
76 |
$query_type |
|
|
77 |
) = $builder->build_query_compat( undef, [$ccl_textbox], [$idx], \@limits ); |
79 |
|
78 |
|
80 |
my $offset = $startfrom > 1 ? $startfrom - 1 : 0; |
79 |
my $offset = $startfrom > 1 ? $startfrom - 1 : 0; |
81 |
|
80 |
|
82 |
my ( $error, $results, $facets ) = $searcher->search_compat( |
81 |
my ( $error, $results, $facets ) = $searcher->search_compat( |
83 |
$query, $simple_query, [], ['biblioserver'], $resultsperpage, $offset, |
82 |
$query, $simple_query, [], ['biblioserver'], $resultsperpage, $offset, |
84 |
undef, undef, $query_type, undef |
83 |
undef, undef, $query_type, undef |
85 |
); |
84 |
); |
86 |
|
85 |
|
87 |
if (!defined $error && defined($results) && @{$results->{biblioserver}{RECORDS}} > 0 ) { |
86 |
if ( !defined $error && defined($results) && @{ $results->{biblioserver}{RECORDS} } > 0 ) { |
88 |
$show_results = grep { defined $_ } @{$results->{biblioserver}{RECORDS}}; |
87 |
$show_results = grep { defined $_ } @{ $results->{biblioserver}{RECORDS} }; |
89 |
$marcresults = [ grep { defined $_ } @{$results->{biblioserver}{RECORDS}} ]; |
88 |
$marcresults = [ grep { defined $_ } @{ $results->{biblioserver}{RECORDS} } ]; |
90 |
$total_hits = $results->{biblioserver}{hits}; |
89 |
$total_hits = $results->{biblioserver}{hits}; |
91 |
} |
90 |
} else { |
92 |
else { |
|
|
93 |
Koha::Logger->get->warn("ERROR label-item-search: no results from simple_search_compat"); |
91 |
Koha::Logger->get->warn("ERROR label-item-search: no results from simple_search_compat"); |
94 |
|
92 |
|
95 |
# leave $show_results undef |
93 |
# leave $show_results undef |
Lines 192-204
if ($show_results) {
Link Here
|
192 |
); |
190 |
); |
193 |
|
191 |
|
194 |
$template->param( |
192 |
$template->param( |
195 |
results => ($show_results ? 1 : 0), |
193 |
results => ( $show_results ? 1 : 0 ), |
196 |
result_set => \@results_set, |
194 |
result_set => \@results_set, |
197 |
batch_id => $batch_id, |
195 |
batch_id => $batch_id, |
198 |
type => $type, |
196 |
type => $type, |
199 |
idx => $idx, |
197 |
idx => $idx, |
200 |
ccl_textbox => $ccl_textbox, |
198 |
ccl_textbox => $ccl_textbox, |
201 |
limits => join(" AND ", @limits), |
199 |
limits => join( " AND ", @limits ), |
202 |
); |
200 |
); |
203 |
} |
201 |
} |
204 |
|
202 |
|