Bugzilla – Attachment 144858 Details for
Bug 26537
Search does not work when no term in value_builder/unimarc_field_4XX.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26537: use QueryBuilder in unimarc_field_4XX plugin to make query
Bug-26537-use-QueryBuilder-in-unimarcfield4XX-plug.patch (text/plain), 2.21 KB, created by
Thibaud Guillot (thibaud_g)
on 2022-12-28 09:46:08 UTC
(
hide
)
Description:
Bug 26537: use QueryBuilder in unimarc_field_4XX plugin to make query
Filename:
MIME Type:
Creator:
Thibaud Guillot (thibaud_g)
Created:
2022-12-28 09:46:08 UTC
Size:
2.21 KB
patch
obsolete
>From b3af09186d677d62915a952b4a65be094bda68a6 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Thu, 1 Oct 2020 15:01:02 +0000 >Subject: [PATCH] Bug 26537: use QueryBuilder in unimarc_field_4XX plugin to > make query > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > cataloguing/value_builder/unimarc_field_4XX.pl | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > >diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl >index 7b0ef28018..a2be2f802c 100755 >--- a/cataloguing/value_builder/unimarc_field_4XX.pl >+++ b/cataloguing/value_builder/unimarc_field_4XX.pl >@@ -35,6 +35,7 @@ use Koha::ItemTypes; > > use Koha::SearchEngine; > use Koha::SearchEngine::Search; >+use Koha::SearchEngine::QueryBuilder; > > sub plugin_parameters { > my ( $dbh, $record, $tagslib, $i ) = @_; >@@ -341,8 +342,13 @@ sub plugin { > my $orderby; > my $op = 'AND'; > $search = 'kw:'.$search." $op mc-itemtype:".$itype if $itype; >+ my $limits = $itype ? ["mc-itype,phr:$itype"] : []; >+ >+ my $builder = Koha::SearchEngine::QueryBuilder->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); > my $searcher = Koha::SearchEngine::Search->new({index => $Koha::SearchEngine::BIBLIOS_INDEX}); >- my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat($search, $startfrom * $resultsperpage, $resultsperpage ); >+ >+ my ($builderror, $es_query)= $builder->build_query_compat( undef, [$search], ['kw'], $limits, ['relevance']); >+ my ( $errors, $results, $total_hits ) = $searcher->simple_search_compat($es_query, $startfrom * $resultsperpage, $resultsperpage ); > if (defined $errors ) { > $results = []; > } >@@ -439,7 +445,7 @@ sub plugin { > if ( $total_hits < $from + $resultsperpage ) { > $to = $total_hits; > }else{ >- $to = $from + $resultsperpage ; >+ $to = $startfrom * $resultsperpage + $resultsperpage ; > } > # my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search"; > # foreach my $sort (@sort_by){ >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26537
:
110756
|
111049
|
128930
|
128931
|
128932
|
128933
|
128934
|
128937
|
128938
|
129607
|
129646
|
129647
| 144858 |
144859