Lines 35-40
use Koha::ItemTypes;
Link Here
|
35 |
|
35 |
|
36 |
use Koha::SearchEngine; |
36 |
use Koha::SearchEngine; |
37 |
use Koha::SearchEngine::Search; |
37 |
use Koha::SearchEngine::Search; |
|
|
38 |
use Koha::SearchEngine::QueryBuilder; |
38 |
|
39 |
|
39 |
sub plugin_parameters { |
40 |
sub plugin_parameters { |
40 |
my ( $dbh, $record, $tagslib, $i ) = @_; |
41 |
my ( $dbh, $record, $tagslib, $i ) = @_; |
Lines 325-331
sub plugin {
Link Here
|
325 |
my $orderby; |
326 |
my $orderby; |
326 |
my $op = 'AND'; |
327 |
my $op = 'AND'; |
327 |
$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"] : []; |
330 |
my $builder = Koha::SearchEngine::QueryBuilder->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); |
328 |
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, $es_query)= $builder->build_query_compat( undef, [$search], ['kw'], $limits, ['relevance']); |
329 |
my ( $errors, $results, $total_hits ) = |
333 |
my ( $errors, $results, $total_hits ) = |
330 |
$searcher->simple_search_compat( $search, $startfrom * $resultsperpage, $resultsperpage ); |
334 |
$searcher->simple_search_compat( $search, $startfrom * $resultsperpage, $resultsperpage ); |
331 |
|
335 |
|
Lines 417-423
sub plugin {
Link Here
|
417 |
if ( $total_hits < $from + $resultsperpage ) { |
421 |
if ( $total_hits < $from + $resultsperpage ) { |
418 |
$to = $total_hits; |
422 |
$to = $total_hits; |
419 |
} else { |
423 |
} else { |
420 |
$to = $from + $resultsperpage; |
424 |
$to = $startfrom * $resultsperpage + $resultsperpage ; |
421 |
} |
425 |
} |
422 |
|
426 |
|
423 |
# 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"; |
424 |
- |
|
|