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

(-)a/C4/Search.pm (-5 / +8 lines)
Lines 1030-1040 sub _build_weighted_query { Link Here
1030
          #$weighted_query .=" or kw,wrdl,r5=\"$operand\"";            # word list any
1030
          #$weighted_query .=" or kw,wrdl,r5=\"$operand\"";            # word list any
1031
        $weighted_query .= " or wrdl,fuzzy,r8=\"$operand\""
1031
        $weighted_query .= " or wrdl,fuzzy,r8=\"$operand\""
1032
          if $fuzzy_enabled;    # add fuzzy, word list
1032
          if $fuzzy_enabled;    # add fuzzy, word list
1033
        $weighted_query .= " or wrdl,right-Truncation,r9=\"$stemmed_operand\""
1033
        if ( $stemming and $stemmed_operand ) {
1034
          if ( $stemming and $stemmed_operand )
1034
            $weighted_query .= " or wrdl,right-Truncation,r9=\"$stemmed_operand\""
1035
          ;                     # add stemming, right truncation
1035
          ;                     # add stemming, right truncation
1036
        $weighted_query .= " or wrdl,r9=\"$operand\"";
1036
        } elsif ( $weight_fields == 2 ) {
1037
1037
            $weighted_query .= " or wrdl,right-Truncation,r9=\"$operand\"";
1038
        } else {
1039
            $weighted_query .= " or wrdl,r9=\"$operand\"";
1040
        }
1038
        # embedded sorting: 0 a-z; 1 z-a
1041
        # embedded sorting: 0 a-z; 1 z-a
1039
        # $weighted_query .= ") or (sort1,aut=1";
1042
        # $weighted_query .= ") or (sort1,aut=1";
1040
    }
1043
    }
Lines 1617-1623 sub buildQuery { Link Here
1617
                # Apply Truncation
1620
                # Apply Truncation
1618
                if (
1621
                if (
1619
                    scalar(@$righttruncated) + scalar(@$lefttruncated) +
1622
                    scalar(@$righttruncated) + scalar(@$lefttruncated) +
1620
                    scalar(@$rightlefttruncated) > 0 )
1623
                    scalar(@$rightlefttruncated) > 0 and $weight_fields < 2 )
1621
                {
1624
                {
1622
1625
1623
               # Don't field weight or add the index to the query, we do it here
1626
               # Don't field weight or add the index to the query, we do it here
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 343-349 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
343
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
343
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
344
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
344
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
345
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
345
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
346
('QueryWeightFields','1',NULL,'If ON, enables field weighting','YesNo'),
346
('QueryWeightFields','1','0|1|2','Enable field weighting research','Choice'),
347
('QuoteOfTheDay','0',NULL,'Enable or disable display of Quote of the Day on the OPAC home page','YesNo'),
347
('QuoteOfTheDay','0',NULL,'Enable or disable display of Quote of the Day on the OPAC home page','YesNo'),
348
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
348
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
349
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
349
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+6 lines)
Lines 9585-9590 if ( CheckVersion($DBversion) ) { Link Here
9585
    SetVersion ($DBversion);
9585
    SetVersion ($DBversion);
9586
}
9586
}
9587
9587
9588
$DBversion = "3.19.00.XXX";
9589
if ( CheckVersion($DBversion) ) {
9590
$dbh->do("UPDATE systempreferences set explanation = 'If ON, enables field weighting with or without automatic right truncation', options = '0|1|2', type= 'Choice' where variable = 'QueryWeightFields'");
9591
    SetVersion ($DBversion);
9592
}
9593
9588
=head1 FUNCTIONS
9594
=head1 FUNCTIONS
9589
9595
9590
=head2 TableExists($table)
9596
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (-5 / +4 lines)
Lines 24-34 Searching: Link Here
24
            - to match words of the same base in a search (for example, a search for <cite>enabling</cite> would also match <cite>enable</cite> and <cite>enabled</cite>; REQUIRES ZEBRA).
24
            - to match words of the same base in a search (for example, a search for <cite>enabling</cite> would also match <cite>enable</cite> and <cite>enabled</cite>; REQUIRES ZEBRA).
25
        -
25
        -
26
            - pref: QueryWeightFields
26
            - pref: QueryWeightFields
27
              type: boolean
27
              default: 1
28
              choices:
28
              choices:
29
                  yes: Enable
29
                  0: Disable ranking of search results by relevance.
30
                  no: Disable
30
                  1: Enable ranking of search results by relevance.
31
            - ranking of search results by relevance (REQUIRES ZEBRA).
31
                  2: Enable ranking of search results by relevance with automatic right truncation.
32
        -
32
        -
33
            - pref: OpacGroupResults
33
            - pref: OpacGroupResults
34
              default: 0
34
              default: 0
35
- 

Return to bug 13414