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

(-)a/C4/Search.pm (-10 / +11 lines)
Lines 1197-1203 sub buildQuery { Link Here
1197
    my $weight_fields    = C4::Context->preference("QueryWeightFields")    || 0;
1197
    my $weight_fields    = C4::Context->preference("QueryWeightFields")    || 0;
1198
    my $fuzzy_enabled    = C4::Context->preference("QueryFuzzy")           || 0;
1198
    my $fuzzy_enabled    = C4::Context->preference("QueryFuzzy")           || 0;
1199
1199
1200
    my $query        = $operands[0];
1200
    my $query        = $operands[0] // "";
1201
    my $simple_query = $operands[0];
1201
    my $simple_query = $operands[0];
1202
1202
1203
    # initialize the variables we're passing back
1203
    # initialize the variables we're passing back
Lines 1350-1356 sub buildQuery { Link Here
1350
				}
1350
				}
1351
1351
1352
                # Detect Truncation
1352
                # Detect Truncation
1353
                my $truncated_operand;
1353
                my $truncated_operand = q{};
1354
                my( $nontruncated, $righttruncated, $lefttruncated,
1354
                my( $nontruncated, $righttruncated, $lefttruncated,
1355
                    $rightlefttruncated, $regexpr
1355
                    $rightlefttruncated, $regexpr
1356
                ) = _detect_truncation( $operand, $index );
1356
                ) = _detect_truncation( $operand, $index );
Lines 1392-1405 sub buildQuery { Link Here
1392
                Koha::Logger->get->debug("TRUNCATED OPERAND: >$truncated_operand<");
1392
                Koha::Logger->get->debug("TRUNCATED OPERAND: >$truncated_operand<");
1393
1393
1394
                # Handle Stemming
1394
                # Handle Stemming
1395
                my $stemmed_operand;
1395
                my $stemmed_operand = q{};
1396
                $stemmed_operand = _build_stemmed_operand($operand, $lang)
1396
                $stemmed_operand = _build_stemmed_operand($operand, $lang)
1397
										if $stemming;
1397
										if $stemming;
1398
1398
1399
                Koha::Logger->get->debug("STEMMED OPERAND: >$stemmed_operand<");
1399
                Koha::Logger->get->debug("STEMMED OPERAND: >$stemmed_operand<");
1400
1400
1401
                # Handle Field Weighting
1401
                # Handle Field Weighting
1402
                my $weighted_operand;
1402
                my $weighted_operand = q{};
1403
                if ($weight_fields) {
1403
                if ($weight_fields) {
1404
                    $weighted_operand = _build_weighted_query( $operand, $stemmed_operand, $index );
1404
                    $weighted_operand = _build_weighted_query( $operand, $stemmed_operand, $index );
1405
                    $operand = $weighted_operand;
1405
                    $operand = $weighted_operand;
Lines 1506-1516 sub buildQuery { Link Here
1506
    $query =~ s/(?<=(st-date-normalized)):/=/g;
1506
    $query =~ s/(?<=(st-date-normalized)):/=/g;
1507
1507
1508
    # Removing warnings for later substitutions
1508
    # Removing warnings for later substitutions
1509
    $query      //= q{};
1509
    $query        //= q{};
1510
    $query_desc //= q{};
1510
    $query_desc   //= q{};
1511
    $query_cgi  //= q{};
1511
    $query_cgi    //= q{};
1512
    $limit      //= q{};
1512
    $limit        //= q{};
1513
    $limit_desc //= q{};
1513
    $limit_desc   //= q{};
1514
    $limit_cgi    //= q{};
1515
    $simple_query //= q{};
1514
    $limit =~ s/:/=/g;
1516
    $limit =~ s/:/=/g;
1515
    for ( $query, $query_desc, $limit, $limit_desc ) {
1517
    for ( $query, $query_desc, $limit, $limit_desc ) {
1516
        s/  +/ /g;    # remove extra spaces
1518
        s/  +/ /g;    # remove extra spaces
1517
- 

Return to bug 28572