View | Details | Raw Unified | Return to bug 24155
Collapse All | Expand All

(-)a/catalogue/search.pl (-1 / +2 lines)
Lines 472-477 my $count = C4::Context->preference('numSearchResults') || 20; Link Here
472
my $results_per_page = $params->{'count'} || $count;
472
my $results_per_page = $params->{'count'} || $count;
473
my $offset = $params->{'offset'} || 0;
473
my $offset = $params->{'offset'} || 0;
474
my $whole_record = $params->{'whole_record'} || 0;
474
my $whole_record = $params->{'whole_record'} || 0;
475
my $weight_search = $params->{'weight_search'} || 0;
475
$offset = 0 if $offset < 0;
476
$offset = 0 if $offset < 0;
476
my $page = $cgi->param('page') || 1;
477
my $page = $cgi->param('page') || 1;
477
#my $offset = ($page-1)*$results_per_page;
478
#my $offset = ($page-1)*$results_per_page;
Lines 491-497 my $searcher = Koha::SearchEngine::Search->new( Link Here
491
    $query_type
492
    $query_type
492
  )
493
  )
493
  = $builder->build_query_compat( \@operators, \@operands, \@indexes, \@limits,
494
  = $builder->build_query_compat( \@operators, \@operands, \@indexes, \@limits,
494
    \@sort_by, $scan, $lang, { weighted_fields => !$cgi->param('advsearch'), whole_record => $whole_record });
495
    \@sort_by, $scan, $lang, { weighted_fields => $weight_search, whole_record => $whole_record });
495
496
496
$template->param( search_query => $query ) if C4::Context->preference('DumpSearchQueryTemplate');
497
$template->param( search_query => $query ) if C4::Context->preference('DumpSearchQueryTemplate');
497
498
(-)a/cataloguing/addbooks.pl (-1 / +1 lines)
Lines 75-81 if ($query) { Link Here
75
    my $searcher = Koha::SearchEngine::Search->new(
75
    my $searcher = Koha::SearchEngine::Search->new(
76
        { index => $Koha::SearchEngine::BIBLIOS_INDEX } );
76
        { index => $Koha::SearchEngine::BIBLIOS_INDEX } );
77
    ( undef, $builtquery, undef, $query_cgi, undef, undef, undef, undef, undef, undef ) =
77
    ( undef, $builtquery, undef, $query_cgi, undef, undef, undef, undef, undef, undef ) =
78
      $builder->build_query_compat( undef, \@operands, undef, undef, undef, 0, $lang );
78
      $builder->build_query_compat( undef, \@operands, undef, undef, undef, 0, $lang, { weighted_fields => 1 });
79
79
80
    $template->param( search_query => $builtquery ) if C4::Context->preference('DumpSearchQueryTemplate');
80
    $template->param( search_query => $builtquery ) if C4::Context->preference('DumpSearchQueryTemplate');
81
81
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (-3 / +7 lines)
Lines 90-98 Link Here
90
<!-- BOOLEAN SEARCH OPTIONS -->
90
<!-- BOOLEAN SEARCH OPTIONS -->
91
    <fieldset id="searchterms">
91
    <fieldset id="searchterms">
92
    <legend>Search for </legend>
92
    <legend>Search for </legend>
93
    [% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %]
93
    [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]
94
        <input type="checkbox" name="whole_record">
94
        [% IF Koha.Preference('ElasticsearchMARCFormat') == 'ARRAY' %]
95
        <label for="whole_record">Search entire MARC record</label>
95
            <input type="checkbox" name="whole_record">
96
            <label for="whole_record">Search entire MARC record</label>
97
        [% END %]
98
        <input type="checkbox" name="weight_search" checked>
99
        <label for="weight_search">Apply field weightings to search</label>
96
    [% END %]
100
    [% END %]
97
    [% FOREACH search_box IN search_boxes_loop %]
101
    [% FOREACH search_box IN search_boxes_loop %]
98
        [% IF ( search_boxes_label ) %]<div style="text-indent: 4.5em;">[% ELSE %]<div>[% END %]
102
        [% IF ( search_boxes_label ) %]<div style="text-indent: 4.5em;">[% ELSE %]<div>[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (+1 lines)
Lines 170-175 Link Here
170
                        [% END %]
170
                        [% END %]
171
                        [% IF Koha.Preference('OpacCustomSearch') == '' %]
171
                        [% IF Koha.Preference('OpacCustomSearch') == '' %]
172
                            <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
172
                            <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
173
                                <input type="hidden" name="weight_search" value="1">
173
                                <label for="masthead_search"> Search
174
                                <label for="masthead_search"> Search
174
                                    [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
175
                                    [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
175
                                        [% IF ( mylibraryfirst ) %]
176
                                        [% IF ( mylibraryfirst ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt (+4 lines)
Lines 24-29 Link Here
24
                    <div id="booleansearch" class="maincontent">
24
                    <div id="booleansearch" class="maincontent">
25
                        <fieldset>
25
                        <fieldset>
26
                            <legend>Search for:</legend>
26
                            <legend>Search for:</legend>
27
                            [% IF Koha.Preference('SearchEngine') == 'Elasticsearch' %]
28
                                <input type="checkbox" name="weight_search" checked>
29
                                <label for="weighted_search">Apply field weightings to search</label>
30
                            [% END %]
27
                            [% FOREACH search_box IN search_boxes_loop %]
31
                            [% FOREACH search_box IN search_boxes_loop %]
28
                                <p>
32
                                <p>
29
                                    [% IF ( expanded_options ) %]
33
                                    [% IF ( expanded_options ) %]
(-)a/opac/opac-search.pl (-2 / +2 lines)
Lines 530-535 $offset = 0 if $offset < 0; Link Here
530
my $page = $cgi->param('page') || 1;
530
my $page = $cgi->param('page') || 1;
531
$offset = ($page-1)*$results_per_page if $page>1;
531
$offset = ($page-1)*$results_per_page if $page>1;
532
my $hits;
532
my $hits;
533
my $weight_search = $cgi->param('weight_search') || 0;
533
534
534
# Define some global variables
535
# Define some global variables
535
my ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$query_type);
536
my ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$query_type);
Lines 562-568 if (C4::Context->preference('OpacSuppression')) { Link Here
562
    {
563
    {
563
        suppress => $suppress,
564
        suppress => $suppress,
564
        is_opac => 1,
565
        is_opac => 1,
565
        weighted_fields => !$cgi->param('advsearch')
566
        weighted_fields => $weight_search
566
    }
567
    }
567
);
568
);
568
569
569
- 

Return to bug 24155