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

(-)a/C4/Search.pm (+12 lines)
Lines 21-26 use C4::Biblio qw( TransformMarcToKoha GetMarcFromKohaField GetFrameworkCode Get Link Here
21
use C4::Koha qw( getFacets GetVariationsOfISBN GetNormalizedUPC GetNormalizedEAN GetNormalizedOCLCNumber GetNormalizedISBN getitemtypeimagelocation );
21
use C4::Koha qw( getFacets GetVariationsOfISBN GetNormalizedUPC GetNormalizedEAN GetNormalizedOCLCNumber GetNormalizedISBN getitemtypeimagelocation );
22
use Koha::DateUtils;
22
use Koha::DateUtils;
23
use Koha::Libraries;
23
use Koha::Libraries;
24
use Koha::SearchEngine::QueryBuilder;
24
use Lingua::Stem;
25
use Lingua::Stem;
25
use XML::Simple;
26
use XML::Simple;
26
use C4::XSLT qw( XSLTParse4Display );
27
use C4::XSLT qw( XSLTParse4Display );
Lines 33-38 use Koha::Logger; Link Here
33
use Koha::Patrons;
34
use Koha::Patrons;
34
use Koha::Recalls;
35
use Koha::Recalls;
35
use Koha::RecordProcessor;
36
use Koha::RecordProcessor;
37
use Koha::SearchFilters;
36
use URI::Escape;
38
use URI::Escape;
37
use Business::ISBN;
39
use Business::ISBN;
38
use MARC::Record;
40
use MARC::Record;
Lines 1507-1512 sub buildQuery { Link Here
1507
            }
1509
            }
1508
            $limit .= "$this_limit";
1510
            $limit .= "$this_limit";
1509
            $limit_desc .= " $this_limit";
1511
            $limit_desc .= " $this_limit";
1512
        } elsif ( $this_limit =~ '^search_filter:' ) {
1513
            $limit_cgi  .= "&limit=" . uri_escape_utf8($this_limit);
1514
            my ($filter_id) = ( $this_limit =~ /^search_filter:(.*)$/ );
1515
            my $search_filter = Koha::SearchFilters->find( $filter_id );
1516
            next unless $search_filter;
1517
            my $expanded = $search_filter->expand_filter;
1518
            my ( $error, undef, undef, undef, undef, $fixed_limit, undef, undef, undef ) = buildQuery ( undef, undef, undef, $expanded, undef, undef, $lang);
1519
            $limit .= " and " if $limit || $query;
1520
            $limit .= "$fixed_limit";
1521
            $limit_desc .= " $limit";
1510
        }
1522
        }
1511
1523
1512
        # Regular old limits
1524
        # Regular old limits
(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-2 / +11 lines)
Lines 796-802 sub _convert_index_strings_freeform { Link Here
796
    # Lower case field names
796
    # Lower case field names
797
    $search =~ s/($field_name_pattern)(?:,[\w-]*)?($multi_field_pattern):/\L$1\E$2:/og;
797
    $search =~ s/($field_name_pattern)(?:,[\w-]*)?($multi_field_pattern):/\L$1\E$2:/og;
798
    # Resolve possible field aliases
798
    # Resolve possible field aliases
799
    $search =~ s/($field_name_pattern)($multi_field_pattern):/(exists $index_field_convert{$1} ? $index_field_convert{$1} : $1)."$2:"/oge;
799
    $search =~ s/($field_name_pattern)($multi_field_pattern):/(exists $index_field_convert{$1} ? $index_field_convert{$1} : $1).($1 eq 'kw' ? "$2" : "$2:")/oge;
800
    return $search;
800
    return $search;
801
}
801
}
802
802
Lines 1059-1064 sub _fix_limit_special_cases { Link Here
1059
            next unless defined($start) && defined($end);
1059
            next unless defined($start) && defined($end);
1060
            push @new_lim, "date-of-publication:[$start TO $end]";
1060
            push @new_lim, "date-of-publication:[$start TO $end]";
1061
        }
1061
        }
1062
        elsif( $l =~ /^search_filter:/ ){
1063
            my ($filter_id) = ( $l =~ /^search_filter:(.*)$/ );
1064
            my $search_filter = Koha::SearchFilters->find( $filter_id );
1065
            next unless $search_filter;
1066
            my $expanded = $search_filter->expand_filter;
1067
            foreach my $e ( @{$self->_fix_limit_special_cases($expanded)} ) {
1068
                push @new_lim, $self->clean_search_term( $e );
1069
            }
1070
#            push @new_lim, @{$self->_fix_limit_special_cases($expanded)};
1071
        }
1062
        elsif ( $l =~ /^yr,st-numeric=/ ) {
1072
        elsif ( $l =~ /^yr,st-numeric=/ ) {
1063
            my ($date) = ( $l =~ /^yr,st-numeric=(.*)$/ );
1073
            my ($date) = ( $l =~ /^yr,st-numeric=(.*)$/ );
1064
            next unless defined($date);
1074
            next unless defined($date);
1065
- 

Return to bug 17170