|
Lines 326-337
sub plugin {
Link Here
|
| 326 |
my $orderby; |
326 |
my $orderby; |
| 327 |
my $op = 'AND'; |
327 |
my $op = 'AND'; |
| 328 |
$search = 'kw:' . $search . " $op mc-itemtype:" . $itype if $itype; |
328 |
$search = 'kw:' . $search . " $op mc-itemtype:" . $itype if $itype; |
| 329 |
my $limits = $itype ? ["mc-itype,phr:$itype"] : []; |
329 |
my $limits = $itype ? ["mc-itype,phr:$itype"] : []; |
| 330 |
my $builder = Koha::SearchEngine::QueryBuilder->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); |
330 |
my $builder = Koha::SearchEngine::QueryBuilder->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
| 331 |
my $searcher = Koha::SearchEngine::Search->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
331 |
my $searcher = Koha::SearchEngine::Search->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
| 332 |
my ($builderror, $search)= $builder->build_query_compat( undef, [$search], ['kw'], $limits, ['relevance']); |
332 |
my ( $builderror, $query_search ) = $builder->build_query_compat( undef, [$search], ['kw'], $limits, ['relevance'] ); |
| 333 |
my ( $errors, $results, $total_hits ) = |
333 |
my ( $errors, $results, $total_hits ) = |
| 334 |
$searcher->simple_search_compat( $search, $startfrom * $resultsperpage, $resultsperpage ); |
334 |
$searcher->simple_search_compat( $query_search, $startfrom * $resultsperpage, $resultsperpage ); |
| 335 |
|
335 |
|
| 336 |
if ( defined $errors ) { |
336 |
if ( defined $errors ) { |
| 337 |
$results = []; |
337 |
$results = []; |
|
Lines 356-362
sub plugin {
Link Here
|
| 356 |
$displaynext = 1; |
356 |
$displaynext = 1; |
| 357 |
} |
357 |
} |
| 358 |
my @arrayresults; |
358 |
my @arrayresults; |
| 359 |
my @field_data = ($search); |
359 |
my @field_data = ($query_search); |
| 360 |
for ( my $i = 0 ; $i < $total && $i < $resultsperpage ; $i++ ) { |
360 |
for ( my $i = 0 ; $i < $total && $i < $resultsperpage ; $i++ ) { |
| 361 |
my $record = C4::Search::new_record_from_zebra( 'biblioserver', $results->[$i] ); |
361 |
my $record = C4::Search::new_record_from_zebra( 'biblioserver', $results->[$i] ); |
| 362 |
next unless $record; |
362 |
next unless $record; |
|
Lines 421-427
sub plugin {
Link Here
|
| 421 |
if ( $total_hits < $from + $resultsperpage ) { |
421 |
if ( $total_hits < $from + $resultsperpage ) { |
| 422 |
$to = $total_hits; |
422 |
$to = $total_hits; |
| 423 |
} else { |
423 |
} else { |
| 424 |
$to = $from * $resultsperpage ; |
424 |
$to = $from * $resultsperpage; |
| 425 |
} |
425 |
} |
| 426 |
|
426 |
|
| 427 |
# my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search"; |
427 |
# my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search"; |
|
Lines 451-457
sub plugin {
Link Here
|
| 451 |
from => $from, |
451 |
from => $from, |
| 452 |
to => $to, |
452 |
to => $to, |
| 453 |
numbers => \@numbers, |
453 |
numbers => \@numbers, |
| 454 |
search => $search, |
454 |
search => $query_search, |
| 455 |
Search => 0 |
455 |
Search => 0 |
| 456 |
); |
456 |
); |
| 457 |
|
457 |
|
| 458 |
- |
|
|