Bugzilla – Attachment 74755 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-sea.patch (text/plain), 2.49 KB, created by
Séverine Queune
on 2018-04-23 16:47:43 UTC
(
hide
)
Description:
Bug 20602 - use weighted fields in OPAC simple search
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2018-04-23 16:47:43 UTC
Size:
2.49 KB
patch
obsolete
>From 785af0d0751798552ba59506cee5d3b06f40f597 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> >--- > .../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 1b7fb90..ded9fc0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >@@ -9,6 +9,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 82a0319..87ba608 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -56,6 +56,7 @@ use Koha::ItemTypes; > use Koha::Ratings; > use Koha::Virtualshelves; > use Koha::Library::Groups; >+use Koha::SearchFields; > > use POSIX qw(ceil floor strftime); > use URI::Escape; >@@ -545,18 +546,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.1.4
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