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 81-87 if ($query) { Link Here
81
        $query_cgi = "q=".uri_escape_utf8($query);
81
        $query_cgi = "q=".uri_escape_utf8($query);
82
    } else {
82
    } else {
83
        ( undef, $builtquery, undef, $query_cgi, undef, undef, undef, undef, undef, undef ) =
83
        ( undef, $builtquery, undef, $query_cgi, undef, undef, undef, undef, undef, undef ) =
84
          $builder->build_query_compat( undef, \@operands, undef, undef, undef, 0, $lang );
84
          $builder->build_query_compat( undef, \@operands, undef, undef, undef, 0, $lang, { weighted_fields => 1 });
85
    }
85
    }
86
86
87
    $template->param( search_query => $builtquery ) if C4::Context->preference('DumpSearchQueryTemplate');
87
    $template->param( search_query => $builtquery ) if C4::Context->preference('DumpSearchQueryTemplate');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (+2 lines)
Lines 117-122 Link Here
117
            [% END %]
117
            [% END %]
118
		</div>
118
		</div>
119
    [% END %]
119
    [% END %]
120
        <label for="weight_search">Apply field weightings to search</label>
121
        <input type="checkbox" name="weight_search" checked>
120
    </fieldset>
122
    </fieldset>
121
<!-- /BOOLEAN SEARCH OPTIONS -->
123
<!-- /BOOLEAN SEARCH OPTIONS -->
122
124
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc (+1 lines)
Lines 172-177 Link Here
172
                        [% END %]
172
                        [% END %]
173
                        [% IF Koha.Preference('OpacCustomSearch') == '' %]
173
                        [% IF Koha.Preference('OpacCustomSearch') == '' %]
174
                            <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
174
                            <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="form-inline">
175
                                <input type="hidden" name="weight_search" value="1">
175
                                <label for="masthead_search"> Search
176
                                <label for="masthead_search"> Search
176
                                    [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
177
                                    [% UNLESS ( Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 ) %]
177
                                        [% IF ( mylibraryfirst ) %]
178
                                        [% IF ( mylibraryfirst ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt (+2 lines)
Lines 107-112 Link Here
107
                                </p>
107
                                </p>
108
                            [% END # FOREACH search_box %]
108
                            [% END # FOREACH search_box %]
109
                        </fieldset>
109
                        </fieldset>
110
                        <label for="weighted_search">Apply field weightings to search</label>
111
                        <input type="checkbox" name="weight_search" checked>
110
                    </div> <!-- /BOOLEAN SEARCH OPTIONS -->
112
                    </div> <!-- /BOOLEAN SEARCH OPTIONS -->
111
                </div> <!-- / .span12 -->
113
                </div> <!-- / .span12 -->
112
            </div> <!-- / .row-fluid -->
114
            </div> <!-- / .row-fluid -->
(-)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