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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-3 / +7 lines)
Lines 1024-1031 sub clean_search_term { Link Here
1024
    # screen all brackets with backslash
1024
    # screen all brackets with backslash
1025
    $term =~ s/(?<!\\)(?:[\\]{2})*([\{\}\[\]])$lookahead/\\$1/g;
1025
    $term =~ s/(?<!\\)(?:[\\]{2})*([\{\}\[\]])$lookahead/\\$1/g;
1026
1026
1027
    # remove problematic punctuation and escaped slashes surrounded by spaces if truncate
1027
    # Remove problematic punctuation  and escaped slashes surrounded by spaces if truncate.
1028
    $term =~ s/\s+(\s*[&;,:\.=\-\/]|(\\\/)\s*)+\s$lookahead/ /g if $truncate;
1028
    # This mainly relates to ISBD punctuation.
1029
    # Note that slashes identified as RE limits will not be removed nor the contents of RE
1030
    # will be altered (cf. @saved_regexes).  In other cases (i.e. escaped slashes
1031
    # (cf. QueryRegexEscapeOptions) and unescaped slashes not identified as being limits
1032
    # to a RE, i.e. the last odd unescaped slash), the slashes will be removed.
1033
    $term =~ s/\s([&;,:\.=\-\/\s]|(\\\/))+\s$lookahead/ /g if $truncate;
1029
1034
1030
    # restore all regex contents after escaping brackets:
1035
    # restore all regex contents after escaping brackets:
1031
    for (my $i = 0; $i < @saved_regexes; $i++) {
1036
    for (my $i = 0; $i < @saved_regexes; $i++) {
1032
- 

Return to bug 37430