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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-3 / +7 lines)
Lines 939-950 sub _clean_search_term { Link Here
939
        $term = $unquoted;
939
        $term = $unquoted;
940
    }
940
    }
941
941
942
    $term = $self->_query_regex_escape_process($term);
943
942
    # Remove unquoted colons that have whitespace on either side of them
944
    # Remove unquoted colons that have whitespace on either side of them
945
    $term =~ s/^[:\s]+//;
946
    $term =~ s/[\s:]+$//;
943
    $term =~ s/(:+)(\s+)$lookahead/$2/g;
947
    $term =~ s/(:+)(\s+)$lookahead/$2/g;
944
    $term =~ s/(\s+)(:+)$lookahead/$1/g;
948
    $term =~ s/(\s+)(:+)$lookahead/$1/g;
945
    $term =~ s/^://;
946
949
947
    $term = $self->_query_regex_escape_process($term);
950
    # screen all followups for colons after first colon,
951
    # and correctly ignore unevenly backslashed:
952
    $term =~ s/((?<!\\)(?:[\\]{2})*:[^:\s]+(?<!\\)(?:[\\]{2})*)(?=:)/$1\\/g;
948
953
949
    return $term;
954
    return $term;
950
}
955
}
951
- 

Return to bug 28316