Skip to content

Commit

Permalink
fix: add forward slash to the set of characters to escape for TAG fie…
Browse files Browse the repository at this point in the history
…ld searches (resolves gh-391)
  • Loading branch information
bsbodden committed Apr 8, 2024
1 parent 6a5062c commit 0102ef9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class QueryUtils {
',', '.', '<', '>', '{', '}', '[', //
']', '"', '\'', ':', ';', '!', '@', //
'#', '$', '%', '^', '&', '*', '(', //
')', '-', '+', '=', '~', '|' //
')', '-', '+', '=', '~', '|', '/' //
);

public static String escape(String text) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -633,4 +633,19 @@ void testReturnedFieldsDeepNestedNonIndexed() {
);
}

@Test
void testEqAgainstContentWithForwardSlash() {
Doc2 doc1 = doc2Repository.save(Doc2.of("This is Picture", "excellent/birds"));
Doc2 doc2 = doc2Repository.save(Doc2.of("Here it comes", "excellent/snow"));

var result = entityStream.of(Doc2.class)
.filter(Doc2$.TAG.eq("excellent/birds"))
.collect(Collectors.toList());

assertThat(result).hasSize(1);
assertThat(result.get(0)).isEqualTo(doc1);

doc2Repository.deleteAll(List.of(doc1, doc2));
}

}

0 comments on commit 0102ef9

Please sign in to comment.