|
Lines 373-382
if ($indexes[0] && (!$indexes[1] || $params->{'scan'})) {
Link Here
|
| 373 |
my @operands = map uri_unescape($_), $cgi->multi_param('q'); |
373 |
my @operands = map uri_unescape($_), $cgi->multi_param('q'); |
| 374 |
|
374 |
|
| 375 |
# if a simple search, display the value in the search box |
375 |
# if a simple search, display the value in the search box |
|
|
376 |
my $basic_search = 0; |
| 376 |
if ($operands[0] && !$operands[1]) { |
377 |
if ($operands[0] && !$operands[1]) { |
| 377 |
my $ms_query = $operands[0]; |
378 |
my $ms_query = $operands[0]; |
| 378 |
$ms_query =~ s/ #\S+//; |
379 |
$ms_query =~ s/ #\S+//; |
| 379 |
$template->param(ms_value => $ms_query); |
380 |
$template->param(ms_value => $ms_query); |
|
|
381 |
$basic_search=1; |
| 380 |
} |
382 |
} |
| 381 |
|
383 |
|
| 382 |
my $available; |
384 |
my $available; |
|
Lines 523-528
for (my $i=0;$i<@servers;$i++) {
Link Here
|
| 523 |
my $server = $servers[$i]; |
525 |
my $server = $servers[$i]; |
| 524 |
if ($server =~/biblioserver/) { # this is the local bibliographic server |
526 |
if ($server =~/biblioserver/) { # this is the local bibliographic server |
| 525 |
my $hits = $results_hashref->{$server}->{"hits"} // 0; |
527 |
my $hits = $results_hashref->{$server}->{"hits"} // 0; |
|
|
528 |
if ( $hits == 0 && $basic_search ){ |
| 529 |
$operands[0] = '"'.$operands[0].'"'; #quote it |
| 530 |
## I. BUILD THE QUERY |
| 531 |
( |
| 532 |
$error, $query, $simple_query, $query_cgi, |
| 533 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
| 534 |
$query_type |
| 535 |
) |
| 536 |
= $builder->build_query_compat( \@operators, \@operands, \@indexes, \@limits, |
| 537 |
\@sort_by, $scan, $lang, { weighted_fields => $weight_search, whole_record => $whole_record }); |
| 538 |
my $quoted_results_hashref; |
| 539 |
eval { |
| 540 |
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } }; |
| 541 |
( $error, $quoted_results_hashref, $facets ) = $searcher->search_compat( |
| 542 |
$query, $simple_query, \@sort_by, ['biblioserver'], |
| 543 |
$results_per_page, $offset, undef, $itemtypes, |
| 544 |
$query_type, $scan |
| 545 |
); |
| 546 |
}; |
| 547 |
my $quoted_hits = $quoted_results_hashref->{$server}->{"hits"} // 0; |
| 548 |
if ( $quoted_hits ){ |
| 549 |
$results_hashref->{'biblioserver'} = $quoted_results_hashref->{'biblioserver'}; |
| 550 |
$hits = $quoted_hits; |
| 551 |
} |
| 552 |
} |
| 526 |
my $page = $cgi->param('page') || 0; |
553 |
my $page = $cgi->param('page') || 0; |
| 527 |
my @newresults = searchResults({ 'interface' => 'intranet' }, $query_desc, $hits, $results_per_page, $offset, $scan, |
554 |
my @newresults = searchResults({ 'interface' => 'intranet' }, $query_desc, $hits, $results_per_page, $offset, $scan, |
| 528 |
$results_hashref->{$server}->{"RECORDS"}); |
555 |
$results_hashref->{$server}->{"RECORDS"}); |