Bugzilla – Attachment 74729 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.35 KB, created by
Alex Arnaud
on 2018-04-23 13:35:14 UTC
(
hide
)
Description:
Bug 20602 - use weighted fields in OPAC simple search
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2018-04-23 13:35:14 UTC
Size:
2.35 KB
patch
obsolete
>From 5cb33d7ac51a59f6f8e34ca732ee509a748775e2 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 >--- > .../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.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