Bugzilla – Attachment 81518 Details for
Bug 20602
Use search fields weight/relevancy on OPAC simple search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20602: Use weighted fields in OPAC simple search
Bug-20602-Use-weighted-fields-in-OPAC-simple-searc.patch (text/plain), 2.56 KB, created by
Martin Renvoize (ashimema)
on 2018-10-29 14:53:12 UTC
(
hide
)
Description:
Bug 20602: Use weighted fields in OPAC simple search
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-10-29 14:53:12 UTC
Size:
2.56 KB
patch
obsolete
>From 80aeb6f3d73bb2adbd1c94dc5cafc218e00b2320 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@gmail.com> >Date: Wed, 18 Apr 2018 14:19:34 +0000 >Subject: [PATCH] Bug 20602: Use weighted fields in OPAC simple search >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan (having Koha working with Elasticsearch): > - apply this patch, > - try searches with and without weight defined on search fields > >https://bugs.koha-community.org/show_bug.cgi?id=20262 >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../bootstrap/en/modules/opac-advsearch.tt | 1 + > opac/opac-search.pl | 22 ++++++++++--------- > 2 files changed, 13 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >index 11e389ace1..1d7aada994 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >@@ -10,6 +10,7 @@ > [% INCLUDE 'bodytag.inc' bodyid='advsearch' bodyclass='scrollto' %] > [% INCLUDE 'masthead.inc' %] > <form action="/cgi-bin/koha/opac-search.pl" method="get"> >+ <input type="hidden" name="advsearch" value="1"/> > <div class="main"> > <ul class="breadcrumb"> > <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li> >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 7aaffef1e5..f38b4e85aa 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -57,6 +57,7 @@ use Koha::Ratings; > use Koha::Virtualshelves; > use Koha::Library::Groups; > use Koha::Patrons; >+use Koha::SearchFields; > > use POSIX qw(ceil floor strftime); > use URI::Escape; >@@ -546,18 +547,19 @@ if (C4::Context->preference('OpacSuppression')) { > } > } > >+my $build_params = { >+ expanded_facet => $expanded_facet, >+ suppress => $suppress >+}; >+ >+unless ( $cgi->param('advsearch') ) { >+ $build_params->{weighted_fields} = 1; >+} >+ > ## I. BUILD THE QUERY > ( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$query_type) >- = $builder->build_query_compat( >- \@operators, >- \@operands, >- \@indexes, >- \@limits, >- \@sort_by, >- 0, >- $lang, >- { expanded_facet => $expanded_facet, suppress => $suppress } >- ); >+ = $builder->build_query_compat( \@operators, \@operands, >+ \@indexes, \@limits, \@sort_by, 0, $lang, $build_params); > > sub _input_cgi_parse { > my @elements; >-- >2.19.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 20602
:
74437
|
74729
|
74755
| 81518