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

(-)a/C4/Search.pm (+5 lines)
Lines 112-117 sub FindDuplicate { Link Here
112
            $titleindex = 'title|exact';
112
            $titleindex = 'title|exact';
113
            $authorindex = 'author|exact';
113
            $authorindex = 'author|exact';
114
            $op = '&&';
114
            $op = '&&';
115
            $QParser->custom_data->{'QueryAutoTruncate'} = C4::Context->preference('QueryAutoTruncate');
115
        } else {
116
        } else {
116
            $titleindex = 'ti,ext';
117
            $titleindex = 'ti,ext';
117
            $authorindex = 'au,ext';
118
            $authorindex = 'au,ext';
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
    if ($QParser) {
238
        $QParser->custom_data->{'QueryAutoTruncate'} = C4::Context->preference('QueryAutoTruncate');
239
    }
236
240
237
    # Initialize & Search Zebra
241
    # Initialize & Search Zebra
238
    for ( my $i = 0 ; $i < @servers ; $i++ ) {
242
    for ( my $i = 0 ; $i < @servers ; $i++ ) {
Lines 1177-1182 sub parseQuery { Link Here
1177
1181
1178
    if ($QParser)
1182
    if ($QParser)
1179
    {
1183
    {
1184
        $QParser->custom_data->{'QueryAutoTruncate'} = C4::Context->preference('QueryAutoTruncate');
1180
        $query = '';
1185
        $query = '';
1181
        for ( my $ii = 0 ; $ii <= @operands ; $ii++ ) {
1186
        for ( my $ii = 0 ; $ii <= @operands ; $ii++ ) {
1182
            next unless $operands[$ii];
1187
            next unless $operands[$ii];
(-)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