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

(-)a/C4/Search.pm (-5 / +8 lines)
Lines 1029-1039 sub _build_weighted_query { Link Here
1029
          #$weighted_query .=" or kw,wrdl,r5=\"$operand\"";            # word list any
1029
          #$weighted_query .=" or kw,wrdl,r5=\"$operand\"";            # word list any
1030
        $weighted_query .= " or wrdl,fuzzy,r8=\"$operand\""
1030
        $weighted_query .= " or wrdl,fuzzy,r8=\"$operand\""
1031
          if $fuzzy_enabled;    # add fuzzy, word list
1031
          if $fuzzy_enabled;    # add fuzzy, word list
1032
        $weighted_query .= " or wrdl,right-Truncation,r9=\"$stemmed_operand\""
1032
        if ( $stemming and $stemmed_operand ) {
1033
          if ( $stemming and $stemmed_operand )
1033
            $weighted_query .= " or wrdl,right-Truncation,r9=\"$stemmed_operand\""
1034
          ;                     # add stemming, right truncation
1034
          ;                     # add stemming, right truncation
1035
        $weighted_query .= " or wrdl,r9=\"$operand\"";
1035
        } elsif ( $weight_fields == 2 ) {
1036
1036
            $weighted_query .= " or wrdl,right-Truncation,r9=\"$operand\"";
1037
        } else {
1038
            $weighted_query .= " or wrdl,r9=\"$operand\"";
1039
        }
1037
        # embedded sorting: 0 a-z; 1 z-a
1040
        # embedded sorting: 0 a-z; 1 z-a
1038
        # $weighted_query .= ") or (sort1,aut=1";
1041
        # $weighted_query .= ") or (sort1,aut=1";
1039
    }
1042
    }
Lines 1623-1629 sub buildQuery { Link Here
1623
                # Apply Truncation
1626
                # Apply Truncation
1624
                if (
1627
                if (
1625
                    scalar(@$righttruncated) + scalar(@$lefttruncated) +
1628
                    scalar(@$righttruncated) + scalar(@$lefttruncated) +
1626
                    scalar(@$rightlefttruncated) > 0 )
1629
                    scalar(@$rightlefttruncated) > 0 and $weight_fields < 2 )
1627
                {
1630
                {
1628
1631
1629
               # Don't field weight or add the index to the query, we do it here
1632
               # 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 (+7 lines)
Lines 10035-10040 if ( CheckVersion($DBversion) ) { Link Here
10035
    SetVersion ($DBversion);
10035
    SetVersion ($DBversion);
10036
}
10036
}
10037
10037
10038
$DBversion = "3.19.00.XXX";
10039
if ( CheckVersion($DBversion) ) {
10040
    $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'");
10041
    SetVersion ($DBversion);
10042
}
10043
10044
10038
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
10045
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
10039
# SEE bug 13068
10046
# SEE bug 13068
10040
# if there is anything in the atomicupdate, read and execute it.
10047
# if there is anything in the atomicupdate, read and execute it.
(-)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