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

(-)a/C4/Matcher.pm (-4 / +10 lines)
Lines 649-655 sub get_matches { Link Here
649
        my $total_hits;
649
        my $total_hits;
650
        if ( $self->{'record_type'} eq 'biblio' ) {
650
        if ( $self->{'record_type'} eq 'biblio' ) {
651
651
652
            if ($QParser) {
652
            #NOTE: The QueryParser can't handle the CCL syntax of 'qualifier','qualifier', so fallback to non-QueryParser.
653
            #NOTE: You can see this in C4::Search::SimpleSearch() as well in a different way.
654
            if ($QParser && $matchpoint->{'index'} !~ m/\w,\w/) {
653
                $query = join( " || ",
655
                $query = join( " || ",
654
                    map { "$matchpoint->{'index'}:$_" } @source_keys );
656
                    map { "$matchpoint->{'index'}:$_" } @source_keys );
655
            }
657
            }
Lines 660-668 sub get_matches { Link Here
660
            }
662
            }
661
663
662
            require C4::Search;
664
            require C4::Search;
663
664
            ( $error, $searchresults, $total_hits ) =
665
            ( $error, $searchresults, $total_hits ) =
665
              C4::Search::SimpleSearch( $query, 0, $max_matches );
666
              C4::Search::SimpleSearch( $query, 0, $max_matches, undef, "skip_normalize" );
666
        }
667
        }
667
        elsif ( $self->{'record_type'} eq 'authority' ) {
668
        elsif ( $self->{'record_type'} eq 'authority' ) {
668
            my $authresults;
669
            my $authresults;
Lines 822-828 sub _get_match_keys { Link Here
822
            } elsif ($component->{'offset'}) {
823
            } elsif ($component->{'offset'}) {
823
                    $string= substr($string, $component->{'offset'});
824
                    $string= substr($string, $component->{'offset'});
824
            }
825
            }
825
            $key = _normalize($string);
826
            $key = $string;
827
            my $norms = $component->{'norms'};
828
            my $normalizer = $norms->[0]; #Matching rules, currently, can only have one normalizer. It will always be defined, even if it's only as ''.
829
            if ($normalizer !~ /(none|raw)/i){
830
                $key = _normalize($string);
831
            }
826
            if ($i == 0) {
832
            if ($i == 0) {
827
                push @keys, $key if $key;
833
                push @keys, $key if $key;
828
            } else {
834
            } else {
(-)a/C4/Search.pm (-4 / +3 lines)
Lines 221-227 $template->param(result=>\@results); Link Here
221
=cut
221
=cut
222
222
223
sub SimpleSearch {
223
sub SimpleSearch {
224
    my ( $query, $offset, $max_results, $servers )  = @_;
224
    my ( $query, $offset, $max_results, $servers, $skip_normalize )  = @_;
225
225
226
    return ( 'No query entered', undef, undef ) unless $query;
226
    return ( 'No query entered', undef, undef ) unless $query;
227
    # FIXME hardcoded value. See catalog/search.pl & opac-search.pl too.
227
    # FIXME hardcoded value. See catalog/search.pl & opac-search.pl too.
Lines 243-254 sub SimpleSearch { Link Here
243
        eval {
243
        eval {
244
            $zconns[$i] = C4::Context->Zconn( $servers[$i], 1 );
244
            $zconns[$i] = C4::Context->Zconn( $servers[$i], 1 );
245
            if ($QParser) {
245
            if ($QParser) {
246
                $query =~ s/=/:/g;
246
                $query =~ s/=/:/g unless $skip_normalize;
247
                $QParser->parse( $query );
247
                $QParser->parse( $query );
248
                $query = $QParser->target_syntax($servers[$i]);
248
                $query = $QParser->target_syntax($servers[$i]);
249
                $zoom_queries[$i] = new ZOOM::Query::PQF( $query, $zconns[$i]);
249
                $zoom_queries[$i] = new ZOOM::Query::PQF( $query, $zconns[$i]);
250
            } else {
250
            } else {
251
                $query =~ s/:/=/g;
251
                $query =~ s/:/=/g unless $skip_normalize;
252
                $zoom_queries[$i] = new ZOOM::Query::CCL2RPN( $query, $zconns[$i]);
252
                $zoom_queries[$i] = new ZOOM::Query::CCL2RPN( $query, $zconns[$i]);
253
            }
253
            }
254
            $tmpresults[$i] = $zconns[$i]->search( $zoom_queries[$i] );
254
            $tmpresults[$i] = $zconns[$i]->search( $zoom_queries[$i] );
255
- 

Return to bug 15541