Bugzilla – Attachment 74437 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.40 KB, created by
Alex Arnaud
on 2018-04-18 14:30:48 UTC
(
hide
)
Description:
Bug 20602 - use weighted fields in OPAC simple search
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2018-04-18 14:30:48 UTC
Size:
2.40 KB
patch
obsolete
>From d96d1b6b7a6aa342cdd2fadea693b4bcdaf7f546 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 > >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 >--- > .../opac-tmpl/bootstrap/en/modules/opac-advsearch.tt | 1 + > opac/opac-search.pl | 19 +++++++++---------- > 2 files changed, 10 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..1ce80b2 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,16 @@ if (C4::Context->preference('OpacSuppression')) { > } > } > >+my ($w_fields, $weight); >+unless ( $cgi->param('advsearch') ) { >+ ($w_fields, $weight) = Koha::SearchFields->weighted_fields(); >+} >+ > ## 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, >+ { expanded_facet => $expanded_facet, suppress => $suppress, w_fields => @$w_fields, weight => @$weight } ); > > sub _input_cgi_parse { > my @elements; >-- >2.7.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