|
Lines 435-445
for ( my $ii = 0 ; $ii < @operands ; ++$ii ) {
Link Here
|
| 435 |
|
435 |
|
| 436 |
# Params that can only have one value |
436 |
# Params that can only have one value |
| 437 |
my $scan = $params->{'scan'}; |
437 |
my $scan = $params->{'scan'}; |
| 438 |
my $count = C4::Context->preference('numSearchResults') || 20; |
438 |
my $count = C4::Context->preference('numSearchResults') || 20; |
| 439 |
my $results_per_page = $params->{'count'} || $count; |
439 |
my $results_per_page = $params->{'count'} || $count; |
| 440 |
my $offset = $params->{'offset'} || 0; |
440 |
my $offset = $params->{'offset'} || 0; |
| 441 |
my $whole_record = $params->{'whole_record'} || 0; |
441 |
my $whole_record = $params->{'whole_record'} || 0; |
| 442 |
my $weight_search = $params->{'advsearch'} ? $params->{'weight_search'} || 0 : 1; |
442 |
my $weight_search = $params->{'weight_search_submitted'} |
|
|
443 |
? ( $params->{'weight_search'} ? 1 : 0 ) # Form was submitted, use actual checkbox value |
| 444 |
: 0; # Form not submitted or no weight_search context |
| 443 |
$offset = 0 if $offset < 0; |
445 |
$offset = 0 if $offset < 0; |
| 444 |
|
446 |
|
| 445 |
# Define some global variables |
447 |
# Define some global variables |
|
Lines 461-467
for ( my $i = 0 ; $i < @operands ; $i++ ) {
Link Here
|
| 461 |
) |
463 |
) |
| 462 |
= $builder->build_query_compat( |
464 |
= $builder->build_query_compat( |
| 463 |
\@operators, \@operands, \@indexes, \@limits, |
465 |
\@operators, \@operands, \@indexes, \@limits, |
| 464 |
\@sort_by, $scan, $lang, { weighted_fields => $weight_search, whole_record => $whole_record } |
466 |
\@sort_by, |
|
|
467 |
$scan, $lang, |
| 468 |
{ |
| 469 |
weighted_fields => $weight_search, |
| 470 |
whole_record => $whole_record, |
| 471 |
weight_search_submitted => $params->{'weight_search_submitted'} |
| 472 |
} |
| 465 |
); |
473 |
); |
| 466 |
|
474 |
|
| 467 |
$template->param( search_query => $query ) if C4::Context->preference('DumpSearchQueryTemplate'); |
475 |
$template->param( search_query => $query ) if C4::Context->preference('DumpSearchQueryTemplate'); |
|
Lines 558-564
if ( $hits == 0 && $basic_search ) {
Link Here
|
| 558 |
) |
566 |
) |
| 559 |
= $builder->build_query_compat( |
567 |
= $builder->build_query_compat( |
| 560 |
\@operators, \@operands, \@indexes, \@limits, |
568 |
\@operators, \@operands, \@indexes, \@limits, |
| 561 |
\@sort_by, $scan, $lang, { weighted_fields => $weight_search, whole_record => $whole_record } |
569 |
\@sort_by, |
|
|
570 |
$scan, $lang, |
| 571 |
{ |
| 572 |
weighted_fields => $weight_search, |
| 573 |
whole_record => $whole_record, |
| 574 |
weight_search_submitted => $params->{'weight_search_submitted'} |
| 575 |
} |
| 562 |
); |
576 |
); |
| 563 |
my $quoted_results_hashref; |
577 |
my $quoted_results_hashref; |
| 564 |
eval { |
578 |
eval { |