Commit 3d1cc9d
committed
fix(query): escape special characters in tag filter values
Add escapeTagValue() method that escapes RediSearch special characters
including spaces in tag values. This prevents syntax errors when tag
values contain hyphens, colons, periods, or other special characters.
- Add escapeTagValue() that calls escapeSpecialCharacters() + space escaping
- Update tag() method to escape each value before building the query
- Add comprehensive test covering hyphens, colons, @, spaces, and multiple values
Test cases verified:
- "test-user-001" → "test\-user\-001"
- "2025-12-10T15:02:37Z" → "2025\-12\-10T15\:02\:37Z"
- "user@example.com" → "user\@example\.com"
- "New York" → "New\ York"1 parent 53b4e91 commit 3d1cc9d
File tree
2 files changed
+41
-2
lines changed- core/src
- main/java/com/redis/vl/query
- test/java/com/redis/vl/query
2 files changed
+41
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
281 | | - | |
| 285 | + | |
282 | 286 | | |
283 | 287 | | |
284 | 288 | | |
| |||
313 | 317 | | |
314 | 318 | | |
315 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
316 | 326 | | |
317 | 327 | | |
318 | 328 | | |
| |||
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
55 | 84 | | |
56 | 85 | | |
57 | 86 | | |
| |||
0 commit comments