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

(-)a/C4/Search.pm (+3 lines)
Lines 104-109 sub FindDuplicate { Link Here
104
    else {
104
    else {
105
        my $QParser;
105
        my $QParser;
106
        $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser'));
106
        $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser'));
107
        $QParser->custom_data->{'QueryAutoTruncate'} = C4::Context->preference('QueryAutoTruncate');
107
        my $titleindex;
108
        my $titleindex;
108
        my $authorindex;
109
        my $authorindex;
109
        my $op;
110
        my $op;
Lines 233-238 sub SimpleSearch { Link Here
233
234
234
    my $QParser;
235
    my $QParser;
235
    $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser') && ! ($query =~ m/\w,\w|\w=\w/));
236
    $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser') && ! ($query =~ m/\w,\w|\w=\w/));
237
    $QParser->custom_data->{'QueryAutoTruncate'} = C4::Context->preference('QueryAutoTruncate');
236
238
237
    # Initialize & Search Zebra
239
    # Initialize & Search Zebra
238
    for ( my $i = 0 ; $i < @servers ; $i++ ) {
240
    for ( my $i = 0 ; $i < @servers ; $i++ ) {
Lines 1172-1177 sub parseQuery { Link Here
1172
1174
1173
    my $QParser;
1175
    my $QParser;
1174
    $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser') || $query =~ s/^qp=//);
1176
    $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser') || $query =~ s/^qp=//);
1177
    $QParser->custom_data->{'QueryAutoTruncate'} = C4::Context->preference('QueryAutoTruncate');
1175
    undef $QParser if ($query =~ m/^(ccl=|pqf=|cql=)/ || grep (/\w,\w|\w=\w/, @operands, @indexes) );
1178
    undef $QParser if ($query =~ m/^(ccl=|pqf=|cql=)/ || grep (/\w,\w|\w=\w/, @operands, @indexes) );
1176
    undef $QParser if (scalar @limits > 0);
1179
    undef $QParser if (scalar @limits > 0);
1177
1180
(-)a/Koha/QueryParser/Driver/PQF.pm (-13 / +13 lines)
Lines 349-371 not want to use it. Link Here
349
sub clear_all_configuration {
349
sub clear_all_configuration {
350
    my ($self) = @_;
350
    my ($self) = @_;
351
    %OpenILS::QueryParser::parser_config = (
351
    %OpenILS::QueryParser::parser_config = (
352
            'OpenILS::QueryParser' => {
352
        'OpenILS::QueryParser' => {
353
            filters => [],
353
            filters => [],
354
            modifiers => [],
354
            modifiers => [],
355
            operators => {
355
            operators => {
356
            'and' => '&&',
356
                'and' => '&&',
357
            'or' => '||',
357
                'or' => '||',
358
            float_start => '{{',
358
                float_start => '{{',
359
            float_end => '}}',
359
                float_end => '}}',
360
            group_start => '(',
360
                group_start => '(',
361
            group_end => ')',
361
                group_end => ')',
362
            required => '+',
362
                required => '+',
363
            disallowed => '-',
363
                disallowed => '-',
364
            modifier => '#',
364
                modifier => '#',
365
            negated => '!'
365
                negated => '!'
366
            }
366
            }
367
            }
367
        }
368
            );
368
    );
369
    return $self;
369
    return $self;
370
}
370
}
371
371
(-)a/Koha/QueryParser/Driver/PQF/query_plan/node.pm (-1 / +4 lines)
Lines 57-62 sub target_syntax { Link Here
57
                $phrase =~ s/"/\\"/g;
57
                $phrase =~ s/"/\\"/g;
58
                $pqf .= ' @or ' x (scalar(@fields) - 1);
58
                $pqf .= ' @or ' x (scalar(@fields) - 1);
59
                foreach my $attributes (@fields) {
59
                foreach my $attributes (@fields) {
60
                    $attributes->{'attr_string'} ||= '';
60
                    $pqf .= $attributes->{'attr_string'} . ($attributes->{'4'} ? '' : ' @attr 4=1') . ' "' . $phrase . '" ';
61
                    $pqf .= $attributes->{'attr_string'} . ($attributes->{'4'} ? '' : ' @attr 4=1') . ' "' . $phrase . '" ';
61
                }
62
                }
62
                $atom_count++;
63
                $atom_count++;
Lines 70-75 sub target_syntax { Link Here
70
                    $pqf .= ' @or ' x (scalar(@fields) - 1);
71
                    $pqf .= ' @or ' x (scalar(@fields) - 1);
71
                    foreach my $attributes (@fields) {
72
                    foreach my $attributes (@fields) {
72
                        $attributes->{'attr_string'} ||= '';
73
                        $attributes->{'attr_string'} ||= '';
74
                        if ($self->plan->QueryParser->custom_data->{'QueryAutoTruncate'} || $atom->suffix eq '*') {
75
                            $attributes->{'attr_string'} .= ($attributes->{'5'} ? '' : ' @attr 5=1 ');
76
                        }
73
                        $pqf .= $attributes->{'attr_string'} . ($attributes->{'4'} ? '' : ' @attr 4=6 ') . $atom_content . ' ';
77
                        $pqf .= $attributes->{'attr_string'} . ($attributes->{'4'} ? '' : ' @attr 4=6 ') . $atom_content . ' ';
74
                    }
78
                    }
75
                    $atom_count++;
79
                    $atom_count++;
76
- 

Return to bug 9961