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

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

Return to bug 15541