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

(-)a/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm (-1 / +1 lines)
Lines 945-951 sub _clean_search_term { Link Here
945
    }
945
    }
946
946
947
    # Remove unquoted colons that have whitespace on either side of them
947
    # Remove unquoted colons that have whitespace on either side of them
948
    $term =~ s/(:+)(\s+)$lookahead/$2/g;
948
    $term =~ s/(:+)(\s+)$lookahead//g;
949
    $term =~ s/(\s+)(:+)$lookahead/$1/g;
949
    $term =~ s/(\s+)(:+)$lookahead/$1/g;
950
    $term =~ s/^://;
950
    $term =~ s/^://;
951
951
(-)a/t/Koha/SearchEngine/Elasticsearch/QueryBuilder.t (-3 / +2 lines)
Lines 208-217 subtest '_clean_search_term() tests' => sub { Link Here
208
    is($res, ' unbalanced  quotes ', 'unbalanced quotes removed');
208
    is($res, ' unbalanced  quotes ', 'unbalanced quotes removed');
209
209
210
    $res = $qb->_clean_search_term('test : query');
210
    $res = $qb->_clean_search_term('test : query');
211
    is($res, 'test  query', 'dangling colon removed');
211
    is($res, 'test query', 'dangling colon removed');
212
212
213
    $res = $qb->_clean_search_term('test :: query');
213
    $res = $qb->_clean_search_term('test :: query');
214
    is($res, 'test  query', 'dangling double colon removed');
214
    is($res, 'test query', 'dangling double colon removed');
215
215
216
    $res = $qb->_clean_search_term('test "another : query"');
216
    $res = $qb->_clean_search_term('test "another : query"');
217
    is($res, 'test "another : query"', 'quoted dangling colon not removed');
217
    is($res, 'test "another : query"', 'quoted dangling colon not removed');
218
- 

Return to bug 27597